diff mbox series

[2/3] fuse: add 'removemapping'

Message ID 20190802171521.21807-3-dgilbert@redhat.com (mailing list archive)
State New, archived
Headers show
Series Fuse definitions for virtiofs | expand

Commit Message

Dr. David Alan Gilbert Aug. 2, 2019, 5:15 p.m. UTC
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

'removemapping' is the complement to 'setupmapping', it unmaps
a range of mapped files from the window visible to the kernel.

A 'removemapping' call consists of 'count' regions to unmap,
each consisting of an offset and length.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Peng Tao <tao.peng@linux.alibaba.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
 include/uapi/linux/fuse.h | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/include/uapi/linux/fuse.h b/include/uapi/linux/fuse.h
index fb79d4d0b3a7..f14eeb5cfc14 100644
--- a/include/uapi/linux/fuse.h
+++ b/include/uapi/linux/fuse.h
@@ -133,7 +133,7 @@ 
  *
  *  7.31
  *  - add FUSE_WRITE_KILL_PRIV flag
- *  - add FUSE_SETUPMAPPING
+ *  - add FUSE_SETUPMAPPING and FUSE_REMOVEMAPPING
  */
 
 #ifndef _LINUX_FUSE_H
@@ -424,6 +424,7 @@  enum fuse_opcode {
 	FUSE_LSEEK		= 46,
 	FUSE_COPY_FILE_RANGE	= 47,
 	FUSE_SETUPMAPPING	= 48,
+	FUSE_REMOVEMAPPING	= 49,
 
 	/* CUSE specific operations */
 	CUSE_INIT		= 4096,
@@ -862,4 +863,16 @@  struct fuse_setupmapping_in {
 	uint64_t	moffset;
 };
 
+struct fuse_removemapping_in {
+	/* number of fuse_removemapping_one following */
+	uint32_t	count;
+};
+
+struct fuse_removemapping_one {
+	/* Offset into the dax window at start of unmapping */
+	uint64_t	moffset;
+	/* Length of unmapping required */
+	uint64_t	len;
+};
+
 #endif /* _LINUX_FUSE_H */