diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2006-06-23 05:05:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-23 10:43:02 -0400 |
commit | 75e1fcc0b18df0a65ab113198e9dc0e98999a08c (patch) | |
tree | 3ac0d0d3120cbca4ee9734494e2c9a4e0775ac4f /include/linux | |
parent | ff7b86b82083f24b8637dff1528c7101c18c7f39 (diff) |
[PATCH] vfs: add lock owner argument to flush operation
Pass the POSIX lock owner ID to the flush operation.
This is useful for filesystems which don't want to store any locking state
in inode->i_flock but want to handle locking/unlocking POSIX locks
internally. FUSE is one such filesystem but I think it possible that some
network filesystems would need this also.
Also add a flag to indicate that a POSIX locking request was generated by
close(), so filesystems using the above feature won't send an extra locking
request in this case.
Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/coda_linux.h | 2 | ||||
-rw-r--r-- | include/linux/fs.h | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h index b3ecf8f71d97..7b5c5df5cb69 100644 --- a/include/linux/coda_linux.h +++ b/include/linux/coda_linux.h | |||
@@ -36,7 +36,7 @@ extern const struct file_operations coda_ioctl_operations; | |||
36 | 36 | ||
37 | /* operations shared over more than one file */ | 37 | /* operations shared over more than one file */ |
38 | int coda_open(struct inode *i, struct file *f); | 38 | int coda_open(struct inode *i, struct file *f); |
39 | int coda_flush(struct file *f); | 39 | int coda_flush(struct file *f, fl_owner_t id); |
40 | int coda_release(struct inode *i, struct file *f); | 40 | int coda_release(struct inode *i, struct file *f); |
41 | int coda_permission(struct inode *inode, int mask, struct nameidata *nd); | 41 | int coda_permission(struct inode *inode, int mask, struct nameidata *nd); |
42 | int coda_revalidate_inode(struct dentry *); | 42 | int coda_revalidate_inode(struct dentry *); |
diff --git a/include/linux/fs.h b/include/linux/fs.h index e917403f4d58..56d8bf0d0a77 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -683,6 +683,7 @@ extern spinlock_t files_lock; | |||
683 | #define FL_FLOCK 2 | 683 | #define FL_FLOCK 2 |
684 | #define FL_ACCESS 8 /* not trying to lock, just looking */ | 684 | #define FL_ACCESS 8 /* not trying to lock, just looking */ |
685 | #define FL_LEASE 32 /* lease held on this file */ | 685 | #define FL_LEASE 32 /* lease held on this file */ |
686 | #define FL_CLOSE 64 /* unlock on close */ | ||
686 | #define FL_SLEEP 128 /* A blocking lock */ | 687 | #define FL_SLEEP 128 /* A blocking lock */ |
687 | 688 | ||
688 | /* | 689 | /* |
@@ -1025,7 +1026,7 @@ struct file_operations { | |||
1025 | long (*compat_ioctl) (struct file *, unsigned int, unsigned long); | 1026 | long (*compat_ioctl) (struct file *, unsigned int, unsigned long); |
1026 | int (*mmap) (struct file *, struct vm_area_struct *); | 1027 | int (*mmap) (struct file *, struct vm_area_struct *); |
1027 | int (*open) (struct inode *, struct file *); | 1028 | int (*open) (struct inode *, struct file *); |
1028 | int (*flush) (struct file *); | 1029 | int (*flush) (struct file *, fl_owner_t id); |
1029 | int (*release) (struct inode *, struct file *); | 1030 | int (*release) (struct inode *, struct file *); |
1030 | int (*fsync) (struct file *, struct dentry *, int datasync); | 1031 | int (*fsync) (struct file *, struct dentry *, int datasync); |
1031 | int (*aio_fsync) (struct kiocb *, int datasync); | 1032 | int (*aio_fsync) (struct kiocb *, int datasync); |