From 8edeaa3f29b418f621542c72d77ba0c639e6d457 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Wed, 6 Jul 2011 12:12:01 +0200 Subject: Add ->flock() operation to low and high level interfaces This fixes problems with emulating flock() with POSIX locking. Reported by Sebastian Pipping. As with lock/setlk/getlk most filesystems don't need to implement this, as the kernel takes care of file locking. The only reason to implement locking operations is for network filesystems which want file locking to work between clients. --- include/fuse_common.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'include/fuse_common.h') diff --git a/include/fuse_common.h b/include/fuse_common.h index db17fa6..76f7200 100644 --- a/include/fuse_common.h +++ b/include/fuse_common.h @@ -70,8 +70,14 @@ struct fuse_file_info { seekable. Introduced in version 2.8 */ unsigned int nonseekable : 1; + /* Indicates that flock locks for this file should be + released. If set, lock_owner shall contain a valid value. + May only be set in ->release(). Introduced in version + 2.9 */ + unsigned int flock_release : 1; + /** Padding. Do not use*/ - unsigned int padding : 28; + unsigned int padding : 27; /** File handle. May be filled in by filesystem in open(). Available in all other file operations */ @@ -103,6 +109,7 @@ struct fuse_file_info { #define FUSE_CAP_SPLICE_WRITE (1 << 7) #define FUSE_CAP_SPLICE_MOVE (1 << 8) #define FUSE_CAP_SPLICE_READ (1 << 9) +#define FUSE_CAP_FLOCK_LOCKS (1 << 10) /** * Ioctl flags -- cgit v1.2.3