Copy from https://gitlab.com/virtio-fs/qemu
@21336c0f3d05a97f5c409bbc894c19d87259655c.

Signed-off-by: Fotis Xenakis <fo...@windowslive.com>
---
 fs/virtiofs/fuse_kernel.h | 88 +++++++++++++++++++++++++++++++++++----
 1 file changed, 81 insertions(+), 7 deletions(-)

diff --git a/fs/virtiofs/fuse_kernel.h b/fs/virtiofs/fuse_kernel.h
index 018a00a2..26e7de1b 100644
--- a/fs/virtiofs/fuse_kernel.h
+++ b/fs/virtiofs/fuse_kernel.h
@@ -38,6 +38,43 @@
  *
  * Protocol changelog:
  *
+ * 7.1:
+ *  - add the following messages:
+ *      FUSE_SETATTR, FUSE_SYMLINK, FUSE_MKNOD, FUSE_MKDIR, FUSE_UNLINK,
+ *      FUSE_RMDIR, FUSE_RENAME, FUSE_LINK, FUSE_OPEN, FUSE_READ, FUSE_WRITE,
+ *      FUSE_RELEASE, FUSE_FSYNC, FUSE_FLUSH, FUSE_SETXATTR, FUSE_GETXATTR,
+ *      FUSE_LISTXATTR, FUSE_REMOVEXATTR, FUSE_OPENDIR, FUSE_READDIR,
+ *      FUSE_RELEASEDIR
+ *  - add padding to messages to accommodate 32-bit servers on 64-bit kernels
+ *
+ * 7.2:
+ *  - add FOPEN_DIRECT_IO and FOPEN_KEEP_CACHE flags
+ *  - add FUSE_FSYNCDIR message
+ *
+ * 7.3:
+ *  - add FUSE_ACCESS message
+ *  - add FUSE_CREATE message
+ *  - add filehandle to fuse_setattr_in
+ *
+ * 7.4:
+ *  - add frsize to fuse_kstatfs
+ *  - clean up request size limit checking
+ *
+ * 7.5:
+ *  - add flags and max_write to fuse_init_out
+ *
+ * 7.6:
+ *  - add max_readahead to fuse_init_in and fuse_init_out
+ *
+ * 7.7:
+ *  - add FUSE_INTERRUPT message
+ *  - add POSIX file lock support
+ *
+ * 7.8:
+ *  - add lock_owner and flags fields to fuse_release_in
+ *  - add FUSE_BMAP message
+ *  - add FUSE_DESTROY message
+ *
  * 7.9:
  *  - new fuse_getattr_in input argument of GETATTR
  *  - add lk_flags in fuse_lk_in
@@ -133,16 +170,14 @@
  *
  *  7.31
  *  - add FUSE_WRITE_KILL_PRIV flag
+ *  - add FUSE_SETUPMAPPING and FUSE_REMOVEMAPPING
+ *  - add map_alignment to fuse_init_out, add FUSE_MAP_ALIGNMENT flag
  */
 
 #ifndef _LINUX_FUSE_H
 #define _LINUX_FUSE_H
 
-#ifdef __KERNEL__
-#include <linux/types.h>
-#else
 #include <stdint.h>
-#endif
 
 /*
  * Version negotiation:
@@ -274,6 +309,7 @@ struct fuse_file_lock {
  * FUSE_CACHE_SYMLINKS: cache READLINK responses
  * FUSE_NO_OPENDIR_SUPPORT: kernel supports zero-message opendir
  * FUSE_EXPLICIT_INVAL_DATA: only invalidate cached pages on explicit request
+ * FUSE_MAP_ALIGNMENT: map_alignment field is valid
  */
 #define FUSE_ASYNC_READ                (1 << 0)
 #define FUSE_POSIX_LOCKS       (1 << 1)
@@ -301,6 +337,7 @@ struct fuse_file_lock {
 #define FUSE_CACHE_SYMLINKS    (1 << 23)
 #define FUSE_NO_OPENDIR_SUPPORT (1 << 24)
 #define FUSE_EXPLICIT_INVAL_DATA (1 << 25)
+#define FUSE_MAP_ALIGNMENT     (1 << 26)
 
 /**
  * CUSE INIT request/reply flags
@@ -422,9 +459,15 @@ enum fuse_opcode {
        FUSE_RENAME2            = 45,
        FUSE_LSEEK              = 46,
        FUSE_COPY_FILE_RANGE    = 47,
+       FUSE_SETUPMAPPING       = 48,
+       FUSE_REMOVEMAPPING      = 49,
 
        /* CUSE specific operations */
-       CUSE_INIT               = 4096
+       CUSE_INIT               = 4096,
+
+       /* Reserved opcodes: helpful to detect structure endian-ness */
+       CUSE_INIT_BSWAP_RESERVED        = 1048576,      /* CUSE_INIT << 8 */
+       FUSE_INIT_BSWAP_RESERVED        = 436207616,    /* FUSE_INIT << 24 */
 };
 
 enum fuse_notify_code {
@@ -434,7 +477,7 @@ enum fuse_notify_code {
        FUSE_NOTIFY_STORE = 4,
        FUSE_NOTIFY_RETRIEVE = 5,
        FUSE_NOTIFY_DELETE = 6,
-       FUSE_NOTIFY_CODE_MAX
+       FUSE_NOTIFY_CODE_MAX,
 };
 
 /* The read buffer is required to be at least 8k, but may be much larger */
@@ -453,6 +496,11 @@ struct fuse_entry_out {
        struct fuse_attr attr;
 };
 
+struct fuse_entryver_out {
+       uint64_t        version_index;
+       int64_t         initial_version;
+};
+
 struct fuse_forget_in {
        uint64_t        nlookup;
 };
@@ -652,7 +700,7 @@ struct fuse_init_out {
        uint32_t        max_write;
        uint32_t        time_gran;
        uint16_t        max_pages;
-       uint16_t        padding;
+       uint16_t        map_alignment;
        uint32_t        unused[8];
 };
 
@@ -845,4 +893,30 @@ struct fuse_copy_file_range_in {
        uint64_t        flags;
 };
 
+#define FUSE_SETUPMAPPING_FLAG_WRITE (1ull << 0)
+struct fuse_setupmapping_in {
+       /* An already open handle */
+       uint64_t        fh;
+       /* Offset into the file to start the mapping */
+       uint64_t        foffset;
+       /* Length of mapping required */
+       uint64_t        len;
+       /* Flags, FUSE_SETUPMAPPING_FLAG_* */
+       uint64_t        flags;
+       /* memory offset in to dax window */
+       uint64_t        moffset;
+};
+
+struct fuse_removemapping_in {
+       /* number of fuse_removemapping_one follows */
+       uint32_t        count;
+};
+
+struct fuse_removemapping_one {
+       /* Offset into the dax to start the unmapping */
+       uint64_t        moffset;
+       /* Length of mapping required */
+       uint64_t        len;
+};
+
 #endif /* _LINUX_FUSE_H */
-- 
2.26.2

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/VI1PR03MB43838F0F348A59568BE77033A6BB0%40VI1PR03MB4383.eurprd03.prod.outlook.com.

Reply via email to