aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2010-05-25 15:06:06 +0200
committerMiklos Szeredi <mszeredi@suse.cz>2010-05-25 15:06:06 +0200
commitdd3bb14f44a6382de2508ec387c7e5569ad2d4f1 (patch)
tree4c84a75f9f40a55f7f7d6da0e3c83b2f073bf4e8 /include
parentb5dd328537edeb4c1d2e71e344b6c443e0874d90 (diff)
downloadkernel_samsung_smdk4412-dd3bb14f44a6382de2508ec387c7e5569ad2d4f1.zip
kernel_samsung_smdk4412-dd3bb14f44a6382de2508ec387c7e5569ad2d4f1.tar.gz
kernel_samsung_smdk4412-dd3bb14f44a6382de2508ec387c7e5569ad2d4f1.tar.bz2
fuse: support splice() writing to fuse device
Allow userspace filesystem implementation to use splice() to write to the fuse device. The semantics of using splice() are: 1) buffer the message header and data in a temporary pipe 2) with a *single* splice() call move the message from the temporary pipe to the fuse device The READ reply message has the most interesting use for this, since now the data from an arbitrary file descriptor (which could be a regular file, a block device or a socket) can be tranferred into the fuse device without having to go through a userspace buffer. It will also allow zero copy moving of pages. One caveat is that the protocol on the fuse device requires the length of the whole message to be written into the header. But the length of the data transferred into the temporary pipe may not be known in advance. The current library implementation works around this by using vmplice to write the header and modifying the header after splicing the data into the pipe (error handling omitted): struct fuse_out_header out; iov.iov_base = &out; iov.iov_len = sizeof(struct fuse_out_header); vmsplice(pip[1], &iov, 1, 0); len = splice(input_fd, input_offset, pip[1], NULL, len, 0); /* retrospectively modify the header: */ out.len = len + sizeof(struct fuse_out_header); splice(pip[0], NULL, fuse_chan_fd(req->ch), NULL, out.len, flags); This works since vmsplice only saves a pointer to the data, it does not copy the data itself. Since pipes are currently limited to 16 pages and messages need to be spliced atomically, the length of the data is limited to 15 pages (or 60kB for 4k pages). Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Diffstat (limited to 'include')
-rw-r--r--include/linux/fuse.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/fuse.h b/include/linux/fuse.h
index 3e2925a..88e0eb5 100644
--- a/include/linux/fuse.h
+++ b/include/linux/fuse.h
@@ -34,6 +34,9 @@
* 7.13
* - make max number of background requests and congestion threshold
* tunables
+ *
+ * 7.14
+ * - add splice support to fuse device
*/
#ifndef _LINUX_FUSE_H
@@ -65,7 +68,7 @@
#define FUSE_KERNEL_VERSION 7
/** Minor version number of this interface */
-#define FUSE_KERNEL_MINOR_VERSION 13
+#define FUSE_KERNEL_MINOR_VERSION 14
/** The node ID of the root inode */
#define FUSE_ROOT_ID 1