3838 *
3939 * Protocol changelog:
4040 *
41+ * 7.1:
42+ * - add the following messages:
43+ * FUSE_SETATTR, FUSE_SYMLINK, FUSE_MKNOD, FUSE_MKDIR, FUSE_UNLINK,
44+ * FUSE_RMDIR, FUSE_RENAME, FUSE_LINK, FUSE_OPEN, FUSE_READ, FUSE_WRITE,
45+ * FUSE_RELEASE, FUSE_FSYNC, FUSE_FLUSH, FUSE_SETXATTR, FUSE_GETXATTR,
46+ * FUSE_LISTXATTR, FUSE_REMOVEXATTR, FUSE_OPENDIR, FUSE_READDIR,
47+ * FUSE_RELEASEDIR
48+ * - add padding to messages to accommodate 32-bit servers on 64-bit kernels
49+ *
50+ * 7.2:
51+ * - add FOPEN_DIRECT_IO and FOPEN_KEEP_CACHE flags
52+ * - add FUSE_FSYNCDIR message
53+ *
54+ * 7.3:
55+ * - add FUSE_ACCESS message
56+ * - add FUSE_CREATE message
57+ * - add filehandle to fuse_setattr_in
58+ *
59+ * 7.4:
60+ * - add frsize to fuse_kstatfs
61+ * - clean up request size limit checking
62+ *
63+ * 7.5:
64+ * - add flags and max_write to fuse_init_out
65+ *
66+ * 7.6:
67+ * - add max_readahead to fuse_init_in and fuse_init_out
68+ *
69+ * 7.7:
70+ * - add FUSE_INTERRUPT message
71+ * - add POSIX file lock support
72+ *
73+ * 7.8:
74+ * - add lock_owner and flags fields to fuse_release_in
75+ * - add FUSE_BMAP message
76+ * - add FUSE_DESTROY message
77+ *
4178 * 7.9:
4279 * - new fuse_getattr_in input argument of GETATTR
4380 * - add lk_flags in fuse_lk_in
133170 *
134171 * 7.31
135172 * - add FUSE_WRITE_KILL_PRIV flag
173+ * - add FUSE_SETUPMAPPING and FUSE_REMOVEMAPPING
174+ * - add map_alignment to fuse_init_out, add FUSE_MAP_ALIGNMENT flag
136175 */
137176
138177#ifndef _LINUX_FUSE_H
139178#define _LINUX_FUSE_H
140179
141- #ifdef __KERNEL__
142- #include <linux/types.h>
143- #else
144180#include <stdint.h>
145- #endif
146181
147182/*
148183 * Version negotiation:
@@ -274,6 +309,7 @@ struct fuse_file_lock {
274309 * FUSE_CACHE_SYMLINKS: cache READLINK responses
275310 * FUSE_NO_OPENDIR_SUPPORT: kernel supports zero-message opendir
276311 * FUSE_EXPLICIT_INVAL_DATA: only invalidate cached pages on explicit request
312+ * FUSE_MAP_ALIGNMENT: map_alignment field is valid
277313 */
278314#define FUSE_ASYNC_READ (1 << 0)
279315#define FUSE_POSIX_LOCKS (1 << 1)
@@ -301,6 +337,7 @@ struct fuse_file_lock {
301337#define FUSE_CACHE_SYMLINKS (1 << 23)
302338#define FUSE_NO_OPENDIR_SUPPORT (1 << 24)
303339#define FUSE_EXPLICIT_INVAL_DATA (1 << 25)
340+ #define FUSE_MAP_ALIGNMENT (1 << 26)
304341
305342/**
306343 * CUSE INIT request/reply flags
@@ -422,9 +459,15 @@ enum fuse_opcode {
422459 FUSE_RENAME2 = 45 ,
423460 FUSE_LSEEK = 46 ,
424461 FUSE_COPY_FILE_RANGE = 47 ,
462+ FUSE_SETUPMAPPING = 48 ,
463+ FUSE_REMOVEMAPPING = 49 ,
425464
426465 /* CUSE specific operations */
427- CUSE_INIT = 4096
466+ CUSE_INIT = 4096 ,
467+
468+ /* Reserved opcodes: helpful to detect structure endian-ness */
469+ CUSE_INIT_BSWAP_RESERVED = 1048576 , /* CUSE_INIT << 8 */
470+ FUSE_INIT_BSWAP_RESERVED = 436207616 , /* FUSE_INIT << 24 */
428471};
429472
430473enum fuse_notify_code {
@@ -434,7 +477,7 @@ enum fuse_notify_code {
434477 FUSE_NOTIFY_STORE = 4 ,
435478 FUSE_NOTIFY_RETRIEVE = 5 ,
436479 FUSE_NOTIFY_DELETE = 6 ,
437- FUSE_NOTIFY_CODE_MAX
480+ FUSE_NOTIFY_CODE_MAX ,
438481};
439482
440483/* The read buffer is required to be at least 8k, but may be much larger */
@@ -453,6 +496,11 @@ struct fuse_entry_out {
453496 struct fuse_attr attr ;
454497};
455498
499+ struct fuse_entryver_out {
500+ uint64_t version_index ;
501+ int64_t initial_version ;
502+ };
503+
456504struct fuse_forget_in {
457505 uint64_t nlookup ;
458506};
@@ -652,7 +700,7 @@ struct fuse_init_out {
652700 uint32_t max_write ;
653701 uint32_t time_gran ;
654702 uint16_t max_pages ;
655- uint16_t padding ;
703+ uint16_t map_alignment ;
656704 uint32_t unused [8 ];
657705};
658706
@@ -845,4 +893,30 @@ struct fuse_copy_file_range_in {
845893 uint64_t flags ;
846894};
847895
896+ #define FUSE_SETUPMAPPING_FLAG_WRITE (1ull << 0)
897+ struct fuse_setupmapping_in {
898+ /* An already open handle */
899+ uint64_t fh ;
900+ /* Offset into the file to start the mapping */
901+ uint64_t foffset ;
902+ /* Length of mapping required */
903+ uint64_t len ;
904+ /* Flags, FUSE_SETUPMAPPING_FLAG_* */
905+ uint64_t flags ;
906+ /* memory offset in to dax window */
907+ uint64_t moffset ;
908+ };
909+
910+ struct fuse_removemapping_in {
911+ /* number of fuse_removemapping_one follows */
912+ uint32_t count ;
913+ };
914+
915+ struct fuse_removemapping_one {
916+ /* Offset into the dax to start the unmapping */
917+ uint64_t moffset ;
918+ /* Length of mapping required */
919+ uint64_t len ;
920+ };
921+
848922#endif /* _LINUX_FUSE_H */
0 commit comments