History

fuse: reserve values for mapping protocol

SETUPMAPPING is a command for use with 'virtiofsd', a fuse-over-virtio implementation; it may find use in other fuse impelementations as well in which the kernel does not have access to the address space of the daemon directly. A SETUPMAPPING operation causes a section of a file to be mapped into a memory window visible to the kernel. The offsets in the file and the window are defined by the kernel performing the operation. The daemon may reject the request, for reasons including permissions and limited resources. When a request perfectly overlaps a previous mapping, the previous mapping is replaced. When a mapping partially overlaps a previous mapping, the previous mapping is split into one or two smaller mappings. REMOVEMAPPING is the complement to SETUPMAPPING; it unmaps a range of mapped files from the window visible to the kernel. The map_alignment field communicates the alignment constraint for FUSE_SETUPMAPPING/FUSE_REMOVEMAPPING and allows the daemon to constrain the addresses and file offsets chosen by the kernel.

Dr. David Alan Gilbert committed 7 years ago

Commit c4bb6671 parent 501ae8e1 file · +7 −1Browse files

Showing the changes to include/uapi/linux (1 of 1 file). Show all

Unified · Split

include/uapi/linux/fuse.h+7−1
@@ -133,6 +133,8 @@ · 132 unmodified lines
133133 *
134134 * 7.31
135135 * - add FUSE_WRITE_KILL_PRIV flag
136+ * - add FUSE_SETUPMAPPING and FUSE_REMOVEMAPPING
137+ * - add map_alignment to fuse_init_out, add FUSE_MAP_ALIGNMENT flag
136138 */
137139
138140 #ifndef _LINUX_FUSE_H
@@ -274,6 +276,7 @@ struct fuse_file_lock { · 135 unmodified lines
274276 * FUSE_CACHE_SYMLINKS: cache READLINK responses
275277 * FUSE_NO_OPENDIR_SUPPORT: kernel supports zero-message opendir
276278 * FUSE_EXPLICIT_INVAL_DATA: only invalidate cached pages on explicit request
279+ * FUSE_MAP_ALIGNMENT: map_alignment field is valid
277280 */
278281 #define FUSE_ASYNC_READ (1 << 0)
279282 #define FUSE_POSIX_LOCKS (1 << 1)
@@ -301,6 +304,7 @@ struct fuse_file_lock { · 21 unmodified lines
301304 #define FUSE_CACHE_SYMLINKS (1 << 23)
302305 #define FUSE_NO_OPENDIR_SUPPORT (1 << 24)
303306 #define FUSE_EXPLICIT_INVAL_DATA (1 << 25)
307+#define FUSE_MAP_ALIGNMENT (1 << 26)
304308
305309 /**
306310 * CUSE INIT request/reply flags
@@ -422,6 +426,8 @@ enum fuse_opcode { · 115 unmodified lines
422426 FUSE_RENAME2 = 45,
423427 FUSE_LSEEK = 46,
424428 FUSE_COPY_FILE_RANGE = 47,
429+ FUSE_SETUPMAPPING = 48,
430+ FUSE_REMOVEMAPPING = 49,
425431
426432 /* CUSE specific operations */
427433 CUSE_INIT = 4096,
@@ -656,7 +662,7 @@ struct fuse_init_out { · 228 unmodified lines
656662 uint32_t max_write;
657663 uint32_t time_gran;
658664 uint16_t max_pages;
659− uint16_t padding;
665+ uint16_t map_alignment;
660666 uint32_t unused[8];
661667 };
662668