aboutsummaryrefslogtreecommitdiffstats
path: root/fs/afs/internal.h
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2007-07-16 02:40:12 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-16 12:05:43 -0400
commite8d6c554126b830217c5e9f549e0e21f865a0a8a (patch)
treec43219c6ef4e6a9b4f0ac46d6bd8b675dc249a8b /fs/afs/internal.h
parentb0fed3140f57c435d2783b698c5090f325c22bad (diff)
AFS: implement file locking
Implement file locking for AFS. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/afs/internal.h')
-rw-r--r--fs/afs/internal.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/fs/afs/internal.h b/fs/afs/internal.h
index 2c55dd94a1de..6306438f331f 100644
--- a/fs/afs/internal.h
+++ b/fs/afs/internal.h
@@ -351,10 +351,18 @@ struct afs_vnode {
351#define AFS_VNODE_ZAP_DATA 3 /* set if vnode's data should be invalidated */ 351#define AFS_VNODE_ZAP_DATA 3 /* set if vnode's data should be invalidated */
352#define AFS_VNODE_DELETED 4 /* set if vnode deleted on server */ 352#define AFS_VNODE_DELETED 4 /* set if vnode deleted on server */
353#define AFS_VNODE_MOUNTPOINT 5 /* set if vnode is a mountpoint symlink */ 353#define AFS_VNODE_MOUNTPOINT 5 /* set if vnode is a mountpoint symlink */
354#define AFS_VNODE_LOCKING 6 /* set if waiting for lock on vnode */
355#define AFS_VNODE_READLOCKED 7 /* set if vnode is read-locked on the server */
356#define AFS_VNODE_WRITELOCKED 8 /* set if vnode is write-locked on the server */
357#define AFS_VNODE_UNLOCKING 9 /* set if vnode is being unlocked on the server */
354 358
355 long acl_order; /* ACL check count (callback break count) */ 359 long acl_order; /* ACL check count (callback break count) */
356 360
357 struct list_head writebacks; /* alterations in pagecache that need writing */ 361 struct list_head writebacks; /* alterations in pagecache that need writing */
362 struct list_head pending_locks; /* locks waiting to be granted */
363 struct list_head granted_locks; /* locks granted on this file */
364 struct delayed_work lock_work; /* work to be done in locking */
365 struct key *unlock_key; /* key to be used in unlocking */
358 366
359 /* outstanding callback notification on this file */ 367 /* outstanding callback notification on this file */
360 struct rb_node server_rb; /* link in server->fs_vnodes */ 368 struct rb_node server_rb; /* link in server->fs_vnodes */
@@ -474,6 +482,15 @@ extern int afs_open(struct inode *, struct file *);
474extern int afs_release(struct inode *, struct file *); 482extern int afs_release(struct inode *, struct file *);
475 483
476/* 484/*
485 * flock.c
486 */
487extern void __exit afs_kill_lock_manager(void);
488extern void afs_lock_work(struct work_struct *);
489extern void afs_lock_may_be_available(struct afs_vnode *);
490extern int afs_lock(struct file *, int, struct file_lock *);
491extern int afs_flock(struct file *, int, struct file_lock *);
492
493/*
477 * fsclient.c 494 * fsclient.c
478 */ 495 */
479extern int afs_fs_fetch_file_status(struct afs_server *, struct key *, 496extern int afs_fs_fetch_file_status(struct afs_server *, struct key *,
@@ -513,6 +530,15 @@ extern int afs_fs_get_volume_status(struct afs_server *, struct key *,
513 struct afs_vnode *, 530 struct afs_vnode *,
514 struct afs_volume_status *, 531 struct afs_volume_status *,
515 const struct afs_wait_mode *); 532 const struct afs_wait_mode *);
533extern int afs_fs_set_lock(struct afs_server *, struct key *,
534 struct afs_vnode *, afs_lock_type_t,
535 const struct afs_wait_mode *);
536extern int afs_fs_extend_lock(struct afs_server *, struct key *,
537 struct afs_vnode *,
538 const struct afs_wait_mode *);
539extern int afs_fs_release_lock(struct afs_server *, struct key *,
540 struct afs_vnode *,
541 const struct afs_wait_mode *);
516 542
517/* 543/*
518 * inode.c 544 * inode.c
@@ -681,6 +707,10 @@ extern int afs_vnode_store_data(struct afs_writeback *, pgoff_t, pgoff_t,
681extern int afs_vnode_setattr(struct afs_vnode *, struct key *, struct iattr *); 707extern int afs_vnode_setattr(struct afs_vnode *, struct key *, struct iattr *);
682extern int afs_vnode_get_volume_status(struct afs_vnode *, struct key *, 708extern int afs_vnode_get_volume_status(struct afs_vnode *, struct key *,
683 struct afs_volume_status *); 709 struct afs_volume_status *);
710extern int afs_vnode_set_lock(struct afs_vnode *, struct key *,
711 afs_lock_type_t);
712extern int afs_vnode_extend_lock(struct afs_vnode *, struct key *);
713extern int afs_vnode_release_lock(struct afs_vnode *, struct key *);
684 714
685/* 715/*
686 * volume.c 716 * volume.c