aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-09-27 18:54:24 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-09-27 18:54:24 -0400
commit8f744bdee4fefb17fac052c7418b830de2b59ac8 (patch)
treeaab0dfba240bf48ed67c32b60a9edb372c7afee9 /include
parent9977b1a71488742606376c09e19e0074e4403cdf (diff)
parenta62a8ef9d97da23762a588592c8b8eb50a8deb6a (diff)
Merge tag 'virtio-fs-5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse
Pull fuse virtio-fs support from Miklos Szeredi: "Virtio-fs allows exporting directory trees on the host and mounting them in guest(s). This isn't actually a new filesystem, but a glue layer between the fuse filesystem and a virtio based back-end. It's similar in functionality to the existing virtio-9p solution, but significantly faster in benchmarks and has better POSIX compliance. Further permformance improvements can be achieved by sharing the page cache between host and guest, allowing for faster I/O and reduced memory use. Kata Containers have been including the out-of-tree virtio-fs (with the shared page cache patches as well) since version 1.7 as an experimental feature. They have been active in development and plan to switch from virtio-9p to virtio-fs as their default solution. There has been interest from other sources as well. The userspace infrastructure is slated to be merged into qemu once the kernel part hits mainline. This was developed by Vivek Goyal, Dave Gilbert and Stefan Hajnoczi" * tag 'virtio-fs-5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse: virtio-fs: add virtiofs filesystem virtio-fs: add Documentation/filesystems/virtiofs.rst fuse: reserve values for mapping protocol
Diffstat (limited to 'include')
-rw-r--r--include/uapi/linux/fuse.h8
-rw-r--r--include/uapi/linux/virtio_fs.h19
-rw-r--r--include/uapi/linux/virtio_ids.h1
3 files changed, 27 insertions, 1 deletions
diff --git a/include/uapi/linux/fuse.h b/include/uapi/linux/fuse.h
index df2e12fb3381..802b0377a49e 100644
--- a/include/uapi/linux/fuse.h
+++ b/include/uapi/linux/fuse.h
@@ -133,6 +133,8 @@
133 * 133 *
134 * 7.31 134 * 7.31
135 * - add FUSE_WRITE_KILL_PRIV flag 135 * - 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
136 */ 138 */
137 139
138#ifndef _LINUX_FUSE_H 140#ifndef _LINUX_FUSE_H
@@ -274,6 +276,7 @@ struct fuse_file_lock {
274 * FUSE_CACHE_SYMLINKS: cache READLINK responses 276 * FUSE_CACHE_SYMLINKS: cache READLINK responses
275 * FUSE_NO_OPENDIR_SUPPORT: kernel supports zero-message opendir 277 * FUSE_NO_OPENDIR_SUPPORT: kernel supports zero-message opendir
276 * FUSE_EXPLICIT_INVAL_DATA: only invalidate cached pages on explicit request 278 * FUSE_EXPLICIT_INVAL_DATA: only invalidate cached pages on explicit request
279 * FUSE_MAP_ALIGNMENT: map_alignment field is valid
277 */ 280 */
278#define FUSE_ASYNC_READ (1 << 0) 281#define FUSE_ASYNC_READ (1 << 0)
279#define FUSE_POSIX_LOCKS (1 << 1) 282#define FUSE_POSIX_LOCKS (1 << 1)
@@ -301,6 +304,7 @@ struct fuse_file_lock {
301#define FUSE_CACHE_SYMLINKS (1 << 23) 304#define FUSE_CACHE_SYMLINKS (1 << 23)
302#define FUSE_NO_OPENDIR_SUPPORT (1 << 24) 305#define FUSE_NO_OPENDIR_SUPPORT (1 << 24)
303#define FUSE_EXPLICIT_INVAL_DATA (1 << 25) 306#define FUSE_EXPLICIT_INVAL_DATA (1 << 25)
307#define FUSE_MAP_ALIGNMENT (1 << 26)
304 308
305/** 309/**
306 * CUSE INIT request/reply flags 310 * CUSE INIT request/reply flags
@@ -422,6 +426,8 @@ enum fuse_opcode {
422 FUSE_RENAME2 = 45, 426 FUSE_RENAME2 = 45,
423 FUSE_LSEEK = 46, 427 FUSE_LSEEK = 46,
424 FUSE_COPY_FILE_RANGE = 47, 428 FUSE_COPY_FILE_RANGE = 47,
429 FUSE_SETUPMAPPING = 48,
430 FUSE_REMOVEMAPPING = 49,
425 431
426 /* CUSE specific operations */ 432 /* CUSE specific operations */
427 CUSE_INIT = 4096, 433 CUSE_INIT = 4096,
@@ -656,7 +662,7 @@ struct fuse_init_out {
656 uint32_t max_write; 662 uint32_t max_write;
657 uint32_t time_gran; 663 uint32_t time_gran;
658 uint16_t max_pages; 664 uint16_t max_pages;
659 uint16_t padding; 665 uint16_t map_alignment;
660 uint32_t unused[8]; 666 uint32_t unused[8];
661}; 667};
662 668
diff --git a/include/uapi/linux/virtio_fs.h b/include/uapi/linux/virtio_fs.h
new file mode 100644
index 000000000000..b02eb2ac3d99
--- /dev/null
+++ b/include/uapi/linux/virtio_fs.h
@@ -0,0 +1,19 @@
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
2
3#ifndef _UAPI_LINUX_VIRTIO_FS_H
4#define _UAPI_LINUX_VIRTIO_FS_H
5
6#include <linux/types.h>
7#include <linux/virtio_ids.h>
8#include <linux/virtio_config.h>
9#include <linux/virtio_types.h>
10
11struct virtio_fs_config {
12 /* Filesystem name (UTF-8, not NUL-terminated, padded with NULs) */
13 __u8 tag[36];
14
15 /* Number of request queues */
16 __u32 num_request_queues;
17} __attribute__((packed));
18
19#endif /* _UAPI_LINUX_VIRTIO_FS_H */
diff --git a/include/uapi/linux/virtio_ids.h b/include/uapi/linux/virtio_ids.h
index 348fd0176f75..585e07b27333 100644
--- a/include/uapi/linux/virtio_ids.h
+++ b/include/uapi/linux/virtio_ids.h
@@ -44,6 +44,7 @@
44#define VIRTIO_ID_VSOCK 19 /* virtio vsock transport */ 44#define VIRTIO_ID_VSOCK 19 /* virtio vsock transport */
45#define VIRTIO_ID_CRYPTO 20 /* virtio crypto */ 45#define VIRTIO_ID_CRYPTO 20 /* virtio crypto */
46#define VIRTIO_ID_IOMMU 23 /* virtio IOMMU */ 46#define VIRTIO_ID_IOMMU 23 /* virtio IOMMU */
47#define VIRTIO_ID_FS 26 /* virtio filesystem */
47#define VIRTIO_ID_PMEM 27 /* virtio pmem */ 48#define VIRTIO_ID_PMEM 27 /* virtio pmem */
48 49
49#endif /* _LINUX_VIRTIO_IDS_H */ 50#endif /* _LINUX_VIRTIO_IDS_H */