diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2007-10-18 06:07:04 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-18 17:37:31 -0400 |
commit | f33321141b273d60cbb3a8f56a5489baad82ba5e (patch) | |
tree | b6443b674600dcdb8c33aa6d44b7a673edc255b4 /include/linux | |
parent | b25e82e5673c750116e8b01a4fc7d09be7809f8c (diff) |
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')
-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 @@ | |||
14 | * 7.9: | 14 | * 7.9: |
15 | * - new fuse_getattr_in input argument of GETATTR | 15 | * - new fuse_getattr_in input argument of GETATTR |
16 | * - add lk_flags in fuse_lk_in | 16 | * - add lk_flags in fuse_lk_in |
17 | * - add lock_owner field to fuse_setattr_in, fuse_read_in and fuse_write_in | ||
17 | */ | 18 | */ |
18 | 19 | ||
19 | #include <asm/types.h> | 20 | #include <asm/types.h> |
@@ -86,6 +87,7 @@ struct fuse_file_lock { | |||
86 | #define FATTR_FH (1 << 6) | 87 | #define FATTR_FH (1 << 6) |
87 | #define FATTR_ATIME_NOW (1 << 7) | 88 | #define FATTR_ATIME_NOW (1 << 7) |
88 | #define FATTR_MTIME_NOW (1 << 8) | 89 | #define FATTR_MTIME_NOW (1 << 8) |
90 | #define FATTR_LOCKOWNER (1 << 9) | ||
89 | 91 | ||
90 | /** | 92 | /** |
91 | * Flags returned by the OPEN request | 93 | * Flags returned by the OPEN request |
@@ -123,8 +125,15 @@ struct fuse_file_lock { | |||
123 | * WRITE flags | 125 | * WRITE flags |
124 | * | 126 | * |
125 | * FUSE_WRITE_CACHE: delayed write from page cache, file handle is guessed | 127 | * FUSE_WRITE_CACHE: delayed write from page cache, file handle is guessed |
128 | * FUSE_WRITE_LOCKOWNER: lock_owner field is valid | ||
126 | */ | 129 | */ |
127 | #define FUSE_WRITE_CACHE (1 << 0) | 130 | #define FUSE_WRITE_CACHE (1 << 0) |
131 | #define FUSE_WRITE_LOCKOWNER (1 << 1) | ||
132 | |||
133 | /** | ||
134 | * Read flags | ||
135 | */ | ||
136 | #define FUSE_READ_LOCKOWNER (1 << 1) | ||
128 | 137 | ||
129 | enum fuse_opcode { | 138 | enum fuse_opcode { |
130 | FUSE_LOOKUP = 1, | 139 | FUSE_LOOKUP = 1, |
@@ -219,7 +228,7 @@ struct fuse_setattr_in { | |||
219 | __u32 padding; | 228 | __u32 padding; |
220 | __u64 fh; | 229 | __u64 fh; |
221 | __u64 size; | 230 | __u64 size; |
222 | __u64 unused1; | 231 | __u64 lock_owner; |
223 | __u64 atime; | 232 | __u64 atime; |
224 | __u64 mtime; | 233 | __u64 mtime; |
225 | __u64 unused2; | 234 | __u64 unused2; |
@@ -262,14 +271,18 @@ struct fuse_read_in { | |||
262 | __u64 fh; | 271 | __u64 fh; |
263 | __u64 offset; | 272 | __u64 offset; |
264 | __u32 size; | 273 | __u32 size; |
265 | __u32 padding; | 274 | __u32 read_flags; |
275 | __u64 lock_owner; | ||
266 | }; | 276 | }; |
267 | 277 | ||
278 | #define FUSE_COMPAT_WRITE_IN_SIZE 24 | ||
279 | |||
268 | struct fuse_write_in { | 280 | struct fuse_write_in { |
269 | __u64 fh; | 281 | __u64 fh; |
270 | __u64 offset; | 282 | __u64 offset; |
271 | __u32 size; | 283 | __u32 size; |
272 | __u32 write_flags; | 284 | __u32 write_flags; |
285 | __u64 lock_owner; | ||
273 | }; | 286 | }; |
274 | 287 | ||
275 | struct fuse_write_out { | 288 | struct fuse_write_out { |