aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2010-06-17 11:54:26 +0000
committerMiklos Szeredi <miklos@szeredi.hu>2010-06-17 11:54:26 +0000
commit1091d73a2872d9794a2f2886e5ed73d6a40766f8 (patch)
treefc2787157c7692bcfd4dfdba492f68b043a87395 /include
parentca14187b22fb3551f049969da69c0ce33e4d35e4 (diff)
downloadandroid_external_fuse-1091d73a2872d9794a2f2886e5ed73d6a40766f8.tar.gz
android_external_fuse-1091d73a2872d9794a2f2886e5ed73d6a40766f8.tar.bz2
android_external_fuse-1091d73a2872d9794a2f2886e5ed73d6a40766f8.zip
Add fuse_reply_fd() reply function to the low level interface
Diffstat (limited to 'include')
-rw-r--r--include/fuse_common.h4
-rw-r--r--include/fuse_lowlevel.h28
2 files changed, 32 insertions, 0 deletions
diff --git a/include/fuse_common.h b/include/fuse_common.h
index c263f6f..c547ac8 100644
--- a/include/fuse_common.h
+++ b/include/fuse_common.h
@@ -89,6 +89,8 @@ struct fuse_file_info {
* FUSE_CAP_EXPORT_SUPPORT: filesystem handles lookups of "." and ".."
* FUSE_CAP_BIG_WRITES: filesystem can handle write size larger than 4kB
* FUSE_CAP_DONT_MASK: don't apply umask to file mode on create operations
+ * FUSE_CAP_SPLICE_WRITE: ability to use splice() to write to the fuse device
+ * FUSE_CAP_SPLICE_MOVE: ability to move data to the fuse device with splice()
*/
#define FUSE_CAP_ASYNC_READ (1 << 0)
#define FUSE_CAP_POSIX_LOCKS (1 << 1)
@@ -96,6 +98,8 @@ struct fuse_file_info {
#define FUSE_CAP_EXPORT_SUPPORT (1 << 4)
#define FUSE_CAP_BIG_WRITES (1 << 5)
#define FUSE_CAP_DONT_MASK (1 << 6)
+#define FUSE_CAP_SPLICE_WRITE (1 << 7)
+#define FUSE_CAP_SPLICE_MOVE (1 << 8)
/**
* Ioctl flags
diff --git a/include/fuse_lowlevel.h b/include/fuse_lowlevel.h
index 2855e51..ad17b07 100644
--- a/include/fuse_lowlevel.h
+++ b/include/fuse_lowlevel.h
@@ -124,6 +124,14 @@ struct fuse_ctx {
#define FUSE_SET_ATTR_ATIME_NOW (1 << 7)
#define FUSE_SET_ATTR_MTIME_NOW (1 << 8)
+/**
+ * flags for fuse_reply_fd()
+ *
+ * FUSE_REPLY_FD_MOVE: attempt to move the data instead of copying
+ * (see SPLICE_F_MOVE flag for splice(2)
+ */
+#define FUSE_REPLY_FD_MOVE (1 << 0)
+
/* ----------------------------------------------------------- *
* Request methods and replies *
* ----------------------------------------------------------- */
@@ -412,6 +420,7 @@ struct fuse_lowlevel_ops {
* Valid replies:
* fuse_reply_buf
* fuse_reply_iov
+ * fuse_reply_fd
* fuse_reply_err
*
* @param req request handle
@@ -561,6 +570,7 @@ struct fuse_lowlevel_ops {
*
* Valid replies:
* fuse_reply_buf
+ * fuse_reply_fd
* fuse_reply_err
*
* @param req request handle
@@ -646,6 +656,7 @@ struct fuse_lowlevel_ops {
*
* Valid replies:
* fuse_reply_buf
+ * fuse_reply_fd
* fuse_reply_xattr
* fuse_reply_err
*
@@ -672,6 +683,7 @@ struct fuse_lowlevel_ops {
*
* Valid replies:
* fuse_reply_buf
+ * fuse_reply_fd
* fuse_reply_xattr
* fuse_reply_err
*
@@ -996,6 +1008,22 @@ int fuse_reply_write(fuse_req_t req, size_t count);
int fuse_reply_buf(fuse_req_t req, const char *buf, size_t size);
/**
+ * Reply with data copied/moved from a file descriptor
+ *
+ * Possible requests:
+ * read, readdir, getxattr, listxattr
+ *
+ * @param req request handle
+ * @param fd file descriptor
+ * @param off offset pointer, may be NULL
+ * @param len length of data in bytes
+ * @param flags FUSE_REPLY_FD_* flags
+ * @return zero for success, -errno for failure to send reply
+ */
+int fuse_reply_fd(fuse_req_t req, int fd, loff_t *off, size_t len,
+ unsigned int flags);
+
+/**
* Reply with data vector
*
* Possible requests: