aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/fuse_kernel.h6
-rw-r--r--include/fuse_lowlevel.h14
-rw-r--r--lib/fuse_lowlevel.c13
-rw-r--r--lib/fuse_versionscript1
4 files changed, 33 insertions, 1 deletions
diff --git a/include/fuse_kernel.h b/include/fuse_kernel.h
index 42db04c..122d658 100644
--- a/include/fuse_kernel.h
+++ b/include/fuse_kernel.h
@@ -232,6 +232,9 @@
*
* 7.43
* - add FUSE_REQUEST_TIMEOUT
+ *
+ * 7.44
+ * - add FUSE_NOTIFY_INC_EPOCH
*/
#ifndef _LINUX_FUSE_H
@@ -267,7 +270,7 @@
#define FUSE_KERNEL_VERSION 7
/** Minor version number of this interface */
-#define FUSE_KERNEL_MINOR_VERSION 42
+#define FUSE_KERNEL_MINOR_VERSION 44
/** The node ID of the root inode */
#define FUSE_ROOT_ID 1
@@ -671,6 +674,7 @@ enum fuse_notify_code {
FUSE_NOTIFY_RETRIEVE = 5,
FUSE_NOTIFY_DELETE = 6,
FUSE_NOTIFY_RESEND = 7,
+ FUSE_NOTIFY_INC_EPOCH = 8,
FUSE_NOTIFY_CODE_MAX,
};
diff --git a/include/fuse_lowlevel.h b/include/fuse_lowlevel.h
index 138a784..82f4a8d 100644
--- a/include/fuse_lowlevel.h
+++ b/include/fuse_lowlevel.h
@@ -1745,6 +1745,20 @@ int fuse_lowlevel_notify_inval_inode(struct fuse_session *se, fuse_ino_t ino,
off_t off, off_t len);
/**
+ * Notify to increment the epoch for the current
+ *
+ * Each fuse connection has an 'epoch', which is initialized during INIT.
+ * Caching will then be validated against the epoch value: if the current epoch
+ * is higher than an object being revalidated, the object is invalid.
+ *
+ * This function simply increment the current epoch value.
+ *
+ * @param se the session object
+ * @return zero for success, -errno for failure
+ */
+int fuse_lowlevel_notify_increment_epoch(struct fuse_session *se);
+
+/**
* Notify to invalidate parent attributes and the dentry matching parent/name
*
* To avoid a deadlock this function must not be called in the
diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c
index 5568786..13c05c6 100644
--- a/lib/fuse_lowlevel.c
+++ b/lib/fuse_lowlevel.c
@@ -2973,6 +2973,19 @@ int fuse_lowlevel_notify_inval_inode(struct fuse_session *se, fuse_ino_t ino,
return send_notify_iov(se, FUSE_NOTIFY_INVAL_INODE, iov, 2);
}
+int fuse_lowlevel_notify_increment_epoch(struct fuse_session *se)
+{
+ struct iovec iov[1];
+
+ if (!se)
+ return -EINVAL;
+
+ if (se->conn.proto_minor < 44)
+ return -ENOSYS;
+
+ return send_notify_iov(se, FUSE_NOTIFY_INC_EPOCH, iov, 1);
+}
+
/**
* Notify parent attributes and the dentry matching parent/name
*
diff --git a/lib/fuse_versionscript b/lib/fuse_versionscript
index ab57d7c..2d8884d 100644
--- a/lib/fuse_versionscript
+++ b/lib/fuse_versionscript
@@ -208,6 +208,7 @@ FUSE_3.18 {
fuse_set_feature_flag;
fuse_unset_feature_flag;
fuse_get_feature_flag;
+ fuse_lowlevel_notify_increment_epoch;
# Not part of public API, for internal test use only
fuse_convert_to_conn_want_ext;