Added support for FUSE_PARALLEL_DIROPS
authorNikolaus Rath <Nikolaus@rath.org>
Tue, 22 Nov 2016 23:05:52 +0000 (15:05 -0800)
committerNikolaus Rath <Nikolaus@rath.org>
Tue, 22 Nov 2016 23:05:52 +0000 (15:05 -0800)
Enabled by default since we haven't released libfuse 3.0 yet :-).

Fixes #112.

ChangeLog.rst
include/fuse_common.h
lib/fuse_lowlevel.c

index 10879df6db96afe876203cb9a8e13d053d7b7b8b..c1d43a284cb6f84b74def01de2e36e8cca32f0df 100644 (file)
@@ -22,6 +22,7 @@ UNRELEASED CHANGES
   particular capability can still be disabled by unsetting the
   corresponding bit of `fuse_conn_info.wants` in the init() handler.
 
+* Added FUSE_CAP_PARALLEL_DIROPS feature flag.
 
 FUSE 3.0.0-rc2 (2016-11-06)
 ===========================
index 966a566bb5dbf027c18ea1554f358c0d008a072a..7bf800843f0496fd4c4380408b6937ee28e7e692 100644 (file)
@@ -242,6 +242,16 @@ struct fuse_file_info {
  */
 #define FUSE_CAP_NO_OPEN_SUPPORT       (1 << 17)
 
+/**
+ * Indicates support for parallel directory operations. If this flag
+ * is unset, the FUSE kernel module will ensure that lookup() and
+ * readdir() requests are never issued concurrently for the same
+ * directory.
+ *
+ * This feature is enabled by default when supported by the kernel.
+ */
+#define FUSE_CAP_PARALLEL_DIROPS        (1 << 18)
+
 /**
  * Ioctl flags
  *
index c53c9f7990fdfbe2865c1e0457add0934e0c2361..c7e3ebf15748f1142a6a20f920b8a9b1df1c648f 100644 (file)
@@ -1875,6 +1875,8 @@ static void do_init(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
                        se->conn.capable |= FUSE_CAP_WRITEBACK_CACHE;
                if (arg->flags & FUSE_NO_OPEN_SUPPORT)
                        se->conn.capable |= FUSE_CAP_NO_OPEN_SUPPORT;
+               if (arg->flags & FUSE_PARALLEL_DIROPS)
+                       se->conn.capable |= FUSE_CAP_PARALLEL_DIROPS;
        } else {
                se->conn.max_readahead = 0;
        }
@@ -1901,6 +1903,7 @@ static void do_init(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
        if ((cond) && (se->conn.capable & (cap))) \
                se->conn.want |= (cap)
        LL_SET_DEFAULT(1, FUSE_CAP_ASYNC_READ);
+       LL_SET_DEFAULT(1, FUSE_CAP_PARALLEL_DIROPS);
        LL_SET_DEFAULT(1, FUSE_CAP_AUTO_INVAL_DATA);
        LL_SET_DEFAULT(1, FUSE_CAP_ASYNC_DIO);
        LL_SET_DEFAULT(1, FUSE_CAP_IOCTL_DIR);