aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/fuse.h27
-rw-r--r--include/fuse_lowlevel.h7
2 files changed, 30 insertions, 4 deletions
diff --git a/include/fuse.h b/include/fuse.h
index ad2ef00..d9041b2 100644
--- a/include/fuse.h
+++ b/include/fuse.h
@@ -68,9 +68,9 @@ typedef int (*fuse_dirfil_t) (fuse_dirh_t h, const char *name, int type,
*
* All methods are optional, but some are essential for a useful
* filesystem (e.g. getattr). Open, flush, release, fsync, opendir,
- * releasedir, fsyncdir, access, create, ftruncate, fgetattr, init and
- * destroy are special purpose methods, without which a full featured
- * filesystem can still be implemented.
+ * releasedir, fsyncdir, access, create, ftruncate, fgetattr, lock,
+ * init and destroy are special purpose methods, without which a full
+ * featured filesystem can still be implemented.
*/
struct fuse_operations {
/** Get file attributes.
@@ -363,6 +363,27 @@ struct fuse_operations {
*/
int (*fgetattr) (const char *, struct stat *, struct fuse_file_info *);
+ /**
+ * Perform POSIX file locking operation
+ *
+ * The cmd argument will be either F_GETLK, F_SETLK or F_SETLKW.
+ *
+ * For the meaning of fields in 'struct flock' see the man page
+ * for fcntl(2). The l_whence field will always be set to
+ * SEEK_SET.
+ *
+ * Unlike fcntl, the l_pid will be set in F_SETLK and F_SETLKW,
+ * and should be used by the filesystem to initialize this field
+ * in F_GETLK.
+ *
+ * For checking lock ownership, the 'owner' argument must be used.
+ *
+ * Note: if this method is not implemented, the kernel will still
+ * allow file locking to work locally. Hence it is only
+ * interesting for network filesystems and similar.
+ *
+ * Introduced in version 2.6
+ */
int (*lock) (const char *, struct fuse_file_info *, int cmd,
struct flock *, uint64_t owner);
};
diff --git a/include/fuse_lowlevel.h b/include/fuse_lowlevel.h
index ede1307..a676830 100644
--- a/include/fuse_lowlevel.h
+++ b/include/fuse_lowlevel.h
@@ -600,8 +600,9 @@ struct fuse_lowlevel_ops {
* fuse_reply_err
*
* @param req request handle
+ * @param ino the inode number, zero means "undefined"
*/
- void (*statfs) (fuse_req_t req);
+ void (*statfs) (fuse_req_t req, fuse_ino_t ino);
/**
* Set an extended attribute
@@ -754,6 +755,10 @@ struct fuse_lowlevel_ops {
* 'struct flock' should only be used to fill in this field in
* getlk().
*
+ * Note: if the locking methods are not implemented, the kernel
+ * will still allow file locking to work locally. Hence these are
+ * only interesting for network filesystems and similar.
+ *
* Valid replies:
* fuse_reply_err
*