summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikolaus Rath <Nikolaus@rath.org>2016-11-22 15:05:52 -0800
committerNikolaus Rath <Nikolaus@rath.org>2016-11-22 15:05:52 -0800
commit3296ad988ddb59eb7bbac21b9f67d60cf38ca6bf (patch)
treefa711d0994908dd481708094f933f8c6d3228bc5
parent5e35dfb5a770aa74b557297f77347725499a1f5c (diff)
downloadfuse-3296ad988ddb59eb7bbac21b9f67d60cf38ca6bf.tar.gz
Added support for FUSE_PARALLEL_DIROPS
Enabled by default since we haven't released libfuse 3.0 yet :-). Fixes #112.
-rw-r--r--ChangeLog.rst1
-rw-r--r--include/fuse_common.h10
-rw-r--r--lib/fuse_lowlevel.c3
3 files changed, 14 insertions, 0 deletions
diff --git a/ChangeLog.rst b/ChangeLog.rst
index 10879df..c1d43a2 100644
--- a/ChangeLog.rst
+++ b/ChangeLog.rst
@@ -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)
===========================
diff --git a/include/fuse_common.h b/include/fuse_common.h
index 966a566..7bf8008 100644
--- a/include/fuse_common.h
+++ b/include/fuse_common.h
@@ -243,6 +243,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
*
* FUSE_IOCTL_COMPAT: 32bit compat ioctl on 64bit machine
diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c
index c53c9f7..c7e3ebf 100644
--- a/lib/fuse_lowlevel.c
+++ b/lib/fuse_lowlevel.c
@@ -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);