[AF_RXRPC]: Add an interface to the AF_RXRPC module for the AFS filesystem to use
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / fs / afs / vnode.h
blob7f6d05b197a61a18d9a46dda7aa1170f432569e9
1 /* AFS vnode record
3 * Copyright (C) 2002 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
12 #ifndef AFS_VNODE_H
13 #define AFS_VNODE_H
15 #include <linux/fs.h>
16 #include "server.h"
17 #include "kafstimod.h"
18 #include "cache.h"
20 struct afs_rxfs_fetch_descriptor;
22 extern struct afs_timer_ops afs_vnode_cb_timed_out_ops;
25 * vnode catalogue entry
27 struct afs_cache_vnode {
28 afs_vnodeid_t vnode_id; /* vnode ID */
29 unsigned vnode_unique; /* vnode ID uniquifier */
30 afs_dataversion_t data_version; /* data version */
33 #ifdef AFS_CACHING_SUPPORT
34 extern struct cachefs_index_def afs_vnode_cache_index_def;
35 #endif
38 * AFS inode private data
40 struct afs_vnode {
41 struct inode vfs_inode; /* the VFS's inode record */
43 struct afs_volume *volume; /* volume on which vnode resides */
44 struct afs_fid fid; /* the file identifier for this inode */
45 struct afs_file_status status; /* AFS status info for this file */
46 #ifdef AFS_CACHING_SUPPORT
47 struct cachefs_cookie *cache; /* caching cookie */
48 #endif
50 wait_queue_head_t update_waitq; /* status fetch waitqueue */
51 unsigned update_cnt; /* number of outstanding ops that will update the
52 * status */
53 spinlock_t lock; /* waitqueue/flags lock */
54 unsigned flags;
55 #define AFS_VNODE_CHANGED 0x00000001 /* set if vnode reported changed by callback */
56 #define AFS_VNODE_DELETED 0x00000002 /* set if vnode deleted on server */
57 #define AFS_VNODE_MOUNTPOINT 0x00000004 /* set if vnode is a mountpoint symlink */
59 /* outstanding callback notification on this file */
60 struct afs_server *cb_server; /* server that made the current promise */
61 struct list_head cb_link; /* link in server's promises list */
62 struct list_head cb_hash_link; /* link in master callback hash */
63 struct afs_timer cb_timeout; /* timeout on promise */
64 unsigned cb_version; /* callback version */
65 unsigned cb_expiry; /* callback expiry time */
66 afs_callback_type_t cb_type; /* type of callback */
69 static inline struct afs_vnode *AFS_FS_I(struct inode *inode)
71 return container_of(inode, struct afs_vnode, vfs_inode);
74 static inline struct inode *AFS_VNODE_TO_I(struct afs_vnode *vnode)
76 return &vnode->vfs_inode;
79 extern int afs_vnode_fetch_status(struct afs_vnode *);
80 extern int afs_vnode_fetch_data(struct afs_vnode *,
81 struct afs_rxfs_fetch_descriptor *);
82 extern int afs_vnode_give_up_callback(struct afs_vnode *);
84 #endif /* AFS_VNODE_H */