History

Merge tag 'fuse-update-5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse

Pull fuse updates from Miklos Szeredi: - Support directly accessing host page cache from virtiofs. This can improve I/O performance for various workloads, as well as reducing the memory requirement by eliminating double caching. Thanks to Vivek Goyal for doing most of the work on this. - Allow automatic submounting inside virtiofs. This allows unique st_dev/ st_ino values to be assigned inside the guest to files residing on different filesystems on the host. Thanks to Max Reitz for the patches. - Fix an old use after free bug found by Pradeep P V K. * tag 'fuse-update-5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse: (25 commits) virtiofs: calculate number of scatter-gather elements accurately fuse: connection remove fix fuse: implement crossmounts fuse: Allow fuse_fill_super_common() for submounts fuse: split fuse_mount off of fuse_conn fuse: drop fuse_conn parameter where possible fuse: store fuse_conn in fuse_req fuse: add submount support to <uapi/linux/fuse.h> fuse: fix page dereference after free virtiofs: add logic to free up a memory range virtiofs: maintain a list of busy elements virtiofs: serialize truncate/punch_hole and dax fault path virtiofs: define dax address space operations virtiofs: add DAX mmap support virtiofs: implement dax read/write operations virtiofs: introduce setupmapping/removemapping commands virtiofs: implement FUSE_INIT map_alignment field virtiofs: keep a list of free dax memory ranges virtiofs: add a mount option to enable dax virtiofs: set up virtio_fs dax_device ...

Linus Torvalds committed 6 years ago

Commit 69456532 parents 922a763 42d3e2d20 files · +2689 −496Browse files

Showing the changes to include/uapi/linux (2 of 20 files). Show all

Unified · Split

2 files
  1. include/uapi/linux/fuse.h +47 −3
  2. include/uapi/linux/virtio_fs.h +3 −0
include/uapi/linux/fuse.h+47−3
@@ -172,6 +172,9 @@ · 171 unmodified lines
172172 * - add FUSE_WRITE_KILL_PRIV flag
173173 * - add FUSE_SETUPMAPPING and FUSE_REMOVEMAPPING
174174 * - add map_alignment to fuse_init_out, add FUSE_MAP_ALIGNMENT flag
175+ *
176+ * 7.32
177+ * - add flags to fuse_attr, add FUSE_ATTR_SUBMOUNT, add FUSE_SUBMOUNTS
175178 */
176179
177180 #ifndef _LINUX_FUSE_H
@@ -207,7 +210,7 @@ · 29 unmodified lines
207210 #define FUSE_KERNEL_VERSION 7
208211
209212 /** Minor version number of this interface */
210−#define FUSE_KERNEL_MINOR_VERSION 31
213+#define FUSE_KERNEL_MINOR_VERSION 32
211214
212215 /** The node ID of the root inode */
213216 #define FUSE_ROOT_ID 1
@@ -231,7 +234,7 @@ struct fuse_attr { · 17 unmodified lines
231234 uint32_t gid;
232235 uint32_t rdev;
233236 uint32_t blksize;
234− uint32_t padding;
237+ uint32_t flags;
235238 };
236239
237240 struct fuse_kstatfs {
@@ -313,7 +316,10 @@ struct fuse_file_lock { · 75 unmodified lines
313316 * FUSE_CACHE_SYMLINKS: cache READLINK responses
314317 * FUSE_NO_OPENDIR_SUPPORT: kernel supports zero-message opendir
315318 * FUSE_EXPLICIT_INVAL_DATA: only invalidate cached pages on explicit request
316− * FUSE_MAP_ALIGNMENT: map_alignment field is valid
319+ * FUSE_MAP_ALIGNMENT: init_out.map_alignment contains log2(byte alignment) for
320+ * foffset and moffset fields in struct
321+ * fuse_setupmapping_out and fuse_removemapping_one.
322+ * FUSE_SUBMOUNTS: kernel supports auto-mounting directory submounts
317323 */
318324 #define FUSE_ASYNC_READ (1 << 0)
319325 #define FUSE_POSIX_LOCKS (1 << 1)
@@ -342,6 +348,7 @@ struct fuse_file_lock { · 22 unmodified lines
342348 #define FUSE_NO_OPENDIR_SUPPORT (1 << 24)
343349 #define FUSE_EXPLICIT_INVAL_DATA (1 << 25)
344350 #define FUSE_MAP_ALIGNMENT (1 << 26)
351+#define FUSE_SUBMOUNTS (1 << 27)
345352
346353 /**
347354 * CUSE INIT request/reply flags
@@ -417,6 +424,13 @@ struct fuse_file_lock { · 69 unmodified lines
417424 */
418425 #define FUSE_FSYNC_FDATASYNC (1 << 0)
419426
427+/**
428+ * fuse_attr flags
429+ *
430+ * FUSE_ATTR_SUBMOUNT: Object is a submount root
431+ */
432+#define FUSE_ATTR_SUBMOUNT (1 << 0)
433+
420434 enum fuse_opcode {
421435 FUSE_LOOKUP = 1,
422436 FUSE_FORGET = 2, /* no reply */
@@ -892,4 +906,34 @@ struct fuse_copy_file_range_in { · 469 unmodified lines
892906 uint64_t flags;
893907 };
894908
909+#define FUSE_SETUPMAPPING_FLAG_WRITE (1ull << 0)
910+#define FUSE_SETUPMAPPING_FLAG_READ (1ull << 1)
911+struct fuse_setupmapping_in {
912+ /* An already open handle */
913+ uint64_t fh;
914+ /* Offset into the file to start the mapping */
915+ uint64_t foffset;
916+ /* Length of mapping required */
917+ uint64_t len;
918+ /* Flags, FUSE_SETUPMAPPING_FLAG_* */
919+ uint64_t flags;
920+ /* Offset in Memory Window */
921+ uint64_t moffset;
922+};
923+
924+struct fuse_removemapping_in {
925+ /* number of fuse_removemapping_one follows */
926+ uint32_t count;
927+};
928+
929+struct fuse_removemapping_one {
930+ /* Offset into the dax window start the unmapping */
931+ uint64_t moffset;
932+ /* Length of mapping required */
933+ uint64_t len;
934+};
935+
936+#define FUSE_REMOVEMAPPING_MAX_ENTRY \
937+ (PAGE_SIZE / sizeof(struct fuse_removemapping_one))
938+
895939 #endif /* _LINUX_FUSE_H */
include/uapi/linux/virtio_fs.h+3−0
@@ -16,4 +16,7 @@ struct virtio_fs_config { · 15 unmodified lines
1616 __le32 num_request_queues;
1717 } __attribute__((packed));
1818
19+/* For the id field in virtio_pci_shm_cap */
20+#define VIRTIO_FS_SHMCAP_ID_CACHE 0
21+
1922 #endif /* _UAPI_LINUX_VIRTIO_FS_H */