diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2007-10-18 03:07:04 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-18 14:37:31 -0700 |
commit | f33321141b273d60cbb3a8f56a5489baad82ba5e (patch) | |
tree | b6443b674600dcdb8c33aa6d44b7a673edc255b4 /include/linux/fuse.h | |
parent | b25e82e5673c750116e8b01a4fc7d09be7809f8c (diff) | |
download | talos-obmc-linux-f33321141b273d60cbb3a8f56a5489baad82ba5e.tar.gz talos-obmc-linux-f33321141b273d60cbb3a8f56a5489baad82ba5e.zip |
fuse: add support for mandatory locking
For mandatory locking the userspace filesystem needs to know the lock
ownership for read, write and truncate operations.
This patch adds the necessary fields to the protocol.
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/fuse.h')
-rw-r--r-- | include/linux/fuse.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/include/linux/fuse.h b/include/linux/fuse.h index 6f4a31266cd5..7d4fa5b25b87 100644 --- a/include/linux/fuse.h +++ b/include/linux/fuse.h @@ -14,6 +14,7 @@ * 7.9: * - new fuse_getattr_in input argument of GETATTR * - add lk_flags in fuse_lk_in + * - add lock_owner field to fuse_setattr_in, fuse_read_in and fuse_write_in */ #include <asm/types.h> @@ -86,6 +87,7 @@ struct fuse_file_lock { #define FATTR_FH (1 << 6) #define FATTR_ATIME_NOW (1 << 7) #define FATTR_MTIME_NOW (1 << 8) +#define FATTR_LOCKOWNER (1 << 9) /** * Flags returned by the OPEN request @@ -123,8 +125,15 @@ struct fuse_file_lock { * WRITE flags * * FUSE_WRITE_CACHE: delayed write from page cache, file handle is guessed + * FUSE_WRITE_LOCKOWNER: lock_owner field is valid */ #define FUSE_WRITE_CACHE (1 << 0) +#define FUSE_WRITE_LOCKOWNER (1 << 1) + +/** + * Read flags + */ +#define FUSE_READ_LOCKOWNER (1 << 1) enum fuse_opcode { FUSE_LOOKUP = 1, @@ -219,7 +228,7 @@ struct fuse_setattr_in { __u32 padding; __u64 fh; __u64 size; - __u64 unused1; + __u64 lock_owner; __u64 atime; __u64 mtime; __u64 unused2; @@ -262,14 +271,18 @@ struct fuse_read_in { __u64 fh; __u64 offset; __u32 size; - __u32 padding; + __u32 read_flags; + __u64 lock_owner; }; +#define FUSE_COMPAT_WRITE_IN_SIZE 24 + struct fuse_write_in { __u64 fh; __u64 offset; __u32 size; __u32 write_flags; + __u64 lock_owner; }; struct fuse_write_out { |