aboutsummaryrefslogtreecommitdiffstats
path: root/include/fuse_lowlevel.h
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2008-12-05 10:55:36 +0000
committerMiklos Szeredi <miklos@szeredi.hu>2008-12-05 10:55:36 +0000
commitecfa5263ab5b19a58d53a7116fb079f3b956b918 (patch)
treea9f9dd2ec17e9185e4d515328b78e3b5e84938f2 /include/fuse_lowlevel.h
parentcafdcb253e4c7ad6238198982425c004b487d2e6 (diff)
downloadlibfuse-ecfa5263ab5b19a58d53a7116fb079f3b956b918.tar.gz
* Implement ioctl support. On high level interface only
"restricted" ioctls are supported (which are defined with the _IO(), _IOR(), _IOW() or _IOWR() macros). Unrestricted ioctls will only be allwed to CUSE (Character Device in Userspace) servers. Patch by Tejun Heo
Diffstat (limited to 'include/fuse_lowlevel.h')
-rw-r--r--include/fuse_lowlevel.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/include/fuse_lowlevel.h b/include/fuse_lowlevel.h
index 9330548..e17274f 100644
--- a/include/fuse_lowlevel.h
+++ b/include/fuse_lowlevel.h
@@ -807,6 +807,36 @@ struct fuse_lowlevel_ops {
*/
void (*bmap) (fuse_req_t req, fuse_ino_t ino, size_t blocksize,
uint64_t idx);
+
+ /**
+ * Ioctl
+ *
+ * Note: For unrestricted ioctls (not allowed for FUSE
+ * servers), data in and out areas can be discovered by giving
+ * iovs and setting FUSE_IOCTL_RETRY in *@flagsp. For
+ * restricted ioctls, kernel prepares in/out data area
+ * according to the information encoded in @cmd.
+ *
+ * Introduced in version 2.9
+ *
+ * Valid replies:
+ * fuse_reply_ioctl_retry
+ * fuse_reply_ioctl
+ * fuse_reply_err
+ *
+ * @param req request handle
+ * @param ino the inode number
+ * @param cmd ioctl command
+ * @param arg ioctl argument
+ * @param fi file information
+ * @param flagsp io/out parameter for FUSE_IOCTL_* flags
+ * @param in_buf data fetched from the caller
+ * @param in_size number of fetched bytes
+ * @param out_size maximum size of output data
+ */
+ void (*ioctl) (fuse_req_t req, fuse_ino_t ino, int cmd, void *arg,
+ struct fuse_file_info *fi, unsigned *flagsp,
+ const void *in_buf, size_t in_bufsz, size_t out_bufszp);
};
/**
@@ -1022,6 +1052,38 @@ size_t fuse_add_direntry(fuse_req_t req, char *buf, size_t bufsize,
const char *name, const struct stat *stbuf,
off_t off);
+/**
+ * Reply to ask for data fetch and output buffer preparation. ioctl
+ * will be retried with the specified input data fetched and output
+ * buffer prepared.
+ *
+ * Possible requests:
+ * ioctl
+ *
+ * @param req request handle
+ * @param in_iov iovec specifying data to fetch from the caller
+ * @param in_count number of entries in @in_iov
+ * @param out_iov iovec specifying addresses to write output to
+ * @param out_count number of entries in @out_iov
+ * @return zero for success, -errno for failure to send reply
+ */
+int fuse_reply_ioctl_retry(fuse_req_t req,
+ const struct iovec *in_iov, size_t in_count,
+ const struct iovec *out_iov, size_t out_count);
+
+/**
+ * Reply to finish ioctl
+ *
+ * Possible requests:
+ * ioctl
+ *
+ * @param req request handle
+ * @param result result to be passed to the caller
+ * @param buf buffer containing output data
+ * @param size length of output data
+ */
+int fuse_reply_ioctl(fuse_req_t req, int result, const void *buf, size_t size);
+
/* ----------------------------------------------------------- *
* Utility functions *
* ----------------------------------------------------------- */