aboutsummaryrefslogtreecommitdiffstats
path: root/fs/afs/internal.h
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2007-04-26 18:59:35 -0400
committerDavid S. Miller <davem@davemloft.net>2007-04-26 18:59:35 -0400
commit260a980317dac80182dd76140cf67c6e81d6d3dd (patch)
tree84f3e919fd33be56aad4fc57f5cb844df1a6b952 /fs/afs/internal.h
parentc35eccb1f614954b10cba3f74b7c301993b2f42e (diff)
[AFS]: Add "directory write" support.
Add support for the create, link, symlink, unlink, mkdir, rmdir and rename VFS operations to the in-kernel AFS filesystem. Also: (1) Fix dentry and inode revalidation. d_revalidate should only look at state of the dentry. Revalidation of the contents of an inode pointed to by a dentry is now separate. (2) Fix afs_lookup() to hash negative dentries as well as positive ones. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'fs/afs/internal.h')
-rw-r--r--fs/afs/internal.h54
1 files changed, 46 insertions, 8 deletions
diff --git a/fs/afs/internal.h b/fs/afs/internal.h
index 6120d4bd19e..73bfa0b2d99 100644
--- a/fs/afs/internal.h
+++ b/fs/afs/internal.h
@@ -80,6 +80,7 @@ struct afs_call {
80 void *reply; /* reply buffer (first part) */ 80 void *reply; /* reply buffer (first part) */
81 void *reply2; /* reply buffer (second part) */ 81 void *reply2; /* reply buffer (second part) */
82 void *reply3; /* reply buffer (third part) */ 82 void *reply3; /* reply buffer (third part) */
83 void *reply4; /* reply buffer (fourth part) */
83 enum { /* call state */ 84 enum { /* call state */
84 AFS_CALL_REQUESTING, /* request is being sent for outgoing call */ 85 AFS_CALL_REQUESTING, /* request is being sent for outgoing call */
85 AFS_CALL_AWAIT_REPLY, /* awaiting reply to outgoing call */ 86 AFS_CALL_AWAIT_REPLY, /* awaiting reply to outgoing call */
@@ -300,19 +301,18 @@ struct afs_vnode {
300#endif 301#endif
301 struct afs_permits *permits; /* cache of permits so far obtained */ 302 struct afs_permits *permits; /* cache of permits so far obtained */
302 struct mutex permits_lock; /* lock for altering permits list */ 303 struct mutex permits_lock; /* lock for altering permits list */
304 struct mutex validate_lock; /* lock for validating this vnode */
303 wait_queue_head_t update_waitq; /* status fetch waitqueue */ 305 wait_queue_head_t update_waitq; /* status fetch waitqueue */
304 unsigned update_cnt; /* number of outstanding ops that will update the 306 int update_cnt; /* number of outstanding ops that will update the
305 * status */ 307 * status */
306 spinlock_t lock; /* waitqueue/flags lock */ 308 spinlock_t lock; /* waitqueue/flags lock */
307 unsigned long flags; 309 unsigned long flags;
308#define AFS_VNODE_CB_BROKEN 0 /* set if vnode's callback was broken */ 310#define AFS_VNODE_CB_BROKEN 0 /* set if vnode's callback was broken */
309#define AFS_VNODE_CHANGED 1 /* set if vnode's metadata changed */ 311#define AFS_VNODE_UNSET 1 /* set if vnode attributes not yet set */
310#define AFS_VNODE_MODIFIED 2 /* set if vnode's data modified */ 312#define AFS_VNODE_MODIFIED 2 /* set if vnode's data modified */
311#define AFS_VNODE_ZAP_DATA 3 /* set if vnode's data should be invalidated */ 313#define AFS_VNODE_ZAP_DATA 3 /* set if vnode's data should be invalidated */
312#define AFS_VNODE_DELETED 4 /* set if vnode deleted on server */ 314#define AFS_VNODE_DELETED 4 /* set if vnode deleted on server */
313#define AFS_VNODE_MOUNTPOINT 5 /* set if vnode is a mountpoint symlink */ 315#define AFS_VNODE_MOUNTPOINT 5 /* set if vnode is a mountpoint symlink */
314#define AFS_VNODE_DIR_CHANGED 6 /* set if vnode's parent dir metadata changed */
315#define AFS_VNODE_DIR_MODIFIED 7 /* set if vnode's parent dir data modified */
316 316
317 long acl_order; /* ACL check count (callback break count) */ 317 long acl_order; /* ACL check count (callback break count) */
318 318
@@ -320,7 +320,6 @@ struct afs_vnode {
320 struct rb_node server_rb; /* link in server->fs_vnodes */ 320 struct rb_node server_rb; /* link in server->fs_vnodes */
321 struct rb_node cb_promise; /* link in server->cb_promises */ 321 struct rb_node cb_promise; /* link in server->cb_promises */
322 struct work_struct cb_broken_work; /* work to be done on callback break */ 322 struct work_struct cb_broken_work; /* work to be done on callback break */
323 struct mutex cb_broken_lock; /* lock against multiple attempts to fix break */
324 time_t cb_expires; /* time at which callback expires */ 323 time_t cb_expires; /* time at which callback expires */
325 time_t cb_expires_at; /* time used to order cb_promise */ 324 time_t cb_expires_at; /* time used to order cb_promise */
326 unsigned cb_version; /* callback version */ 325 unsigned cb_version; /* callback version */
@@ -388,6 +387,7 @@ extern void afs_init_callback_state(struct afs_server *);
388extern void afs_broken_callback_work(struct work_struct *); 387extern void afs_broken_callback_work(struct work_struct *);
389extern void afs_break_callbacks(struct afs_server *, size_t, 388extern void afs_break_callbacks(struct afs_server *, size_t,
390 struct afs_callback[]); 389 struct afs_callback[]);
390extern void afs_discard_callback_on_delete(struct afs_vnode *);
391extern void afs_give_up_callback(struct afs_vnode *); 391extern void afs_give_up_callback(struct afs_vnode *);
392extern void afs_dispatch_give_up_callbacks(struct work_struct *); 392extern void afs_dispatch_give_up_callbacks(struct work_struct *);
393extern void afs_flush_callback_breaks(struct afs_server *); 393extern void afs_flush_callback_breaks(struct afs_server *);
@@ -448,14 +448,34 @@ extern int afs_fs_give_up_callbacks(struct afs_server *,
448 const struct afs_wait_mode *); 448 const struct afs_wait_mode *);
449extern int afs_fs_fetch_data(struct afs_server *, struct key *, 449extern int afs_fs_fetch_data(struct afs_server *, struct key *,
450 struct afs_vnode *, off_t, size_t, struct page *, 450 struct afs_vnode *, off_t, size_t, struct page *,
451 struct afs_volsync *,
452 const struct afs_wait_mode *); 451 const struct afs_wait_mode *);
452extern int afs_fs_create(struct afs_server *, struct key *,
453 struct afs_vnode *, const char *, umode_t,
454 struct afs_fid *, struct afs_file_status *,
455 struct afs_callback *,
456 const struct afs_wait_mode *);
457extern int afs_fs_remove(struct afs_server *, struct key *,
458 struct afs_vnode *, const char *, bool,
459 const struct afs_wait_mode *);
460extern int afs_fs_link(struct afs_server *, struct key *, struct afs_vnode *,
461 struct afs_vnode *, const char *,
462 const struct afs_wait_mode *);
463extern int afs_fs_symlink(struct afs_server *, struct key *,
464 struct afs_vnode *, const char *, const char *,
465 struct afs_fid *, struct afs_file_status *,
466 const struct afs_wait_mode *);
467extern int afs_fs_rename(struct afs_server *, struct key *,
468 struct afs_vnode *, const char *,
469 struct afs_vnode *, const char *,
470 const struct afs_wait_mode *);
453 471
454/* 472/*
455 * inode.c 473 * inode.c
456 */ 474 */
457extern struct inode *afs_iget(struct super_block *, struct key *, 475extern struct inode *afs_iget(struct super_block *, struct key *,
458 struct afs_fid *); 476 struct afs_fid *, struct afs_file_status *,
477 struct afs_callback *);
478extern int afs_validate(struct afs_vnode *, struct key *);
459extern int afs_inode_getattr(struct vfsmount *, struct dentry *, 479extern int afs_inode_getattr(struct vfsmount *, struct dentry *,
460 struct kstat *); 480 struct kstat *);
461extern void afs_zap_permits(struct rcu_head *); 481extern void afs_zap_permits(struct rcu_head *);
@@ -522,7 +542,11 @@ extern int afs_permission(struct inode *, int, struct nameidata *);
522 */ 542 */
523extern spinlock_t afs_server_peer_lock; 543extern spinlock_t afs_server_peer_lock;
524 544
525#define afs_get_server(S) do { atomic_inc(&(S)->usage); } while(0) 545#define afs_get_server(S) \
546do { \
547 _debug("GET SERVER %d", atomic_read(&(S)->usage)); \
548 atomic_inc(&(S)->usage); \
549} while(0)
526 550
527extern struct afs_server *afs_lookup_server(struct afs_cell *, 551extern struct afs_server *afs_lookup_server(struct afs_cell *,
528 const struct in_addr *); 552 const struct in_addr *);
@@ -588,10 +612,24 @@ static inline struct inode *AFS_VNODE_TO_I(struct afs_vnode *vnode)
588 return &vnode->vfs_inode; 612 return &vnode->vfs_inode;
589} 613}
590 614
615extern void afs_vnode_finalise_status_update(struct afs_vnode *,
616 struct afs_server *);
591extern int afs_vnode_fetch_status(struct afs_vnode *, struct afs_vnode *, 617extern int afs_vnode_fetch_status(struct afs_vnode *, struct afs_vnode *,
592 struct key *); 618 struct key *);
593extern int afs_vnode_fetch_data(struct afs_vnode *, struct key *, 619extern int afs_vnode_fetch_data(struct afs_vnode *, struct key *,
594 off_t, size_t, struct page *); 620 off_t, size_t, struct page *);
621extern int afs_vnode_create(struct afs_vnode *, struct key *, const char *,
622 umode_t, struct afs_fid *, struct afs_file_status *,
623 struct afs_callback *, struct afs_server **);
624extern int afs_vnode_remove(struct afs_vnode *, struct key *, const char *,
625 bool);
626extern int afs_vnode_link(struct afs_vnode *, struct afs_vnode *, struct key *,
627 const char *);
628extern int afs_vnode_symlink(struct afs_vnode *, struct key *, const char *,
629 const char *, struct afs_fid *,
630 struct afs_file_status *, struct afs_server **);
631extern int afs_vnode_rename(struct afs_vnode *, struct afs_vnode *,
632 struct key *, const char *, const char *);
595 633
596/* 634/*
597 * volume.c 635 * volume.c