aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse/cuse.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/fuse/cuse.c')
-rw-r--r--fs/fuse/cuse.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/fs/fuse/cuse.c b/fs/fuse/cuse.c
index 28d0c7abba1c..e5bbf748b698 100644
--- a/fs/fuse/cuse.c
+++ b/fs/fuse/cuse.c
@@ -38,7 +38,6 @@
38#include <linux/device.h> 38#include <linux/device.h>
39#include <linux/file.h> 39#include <linux/file.h>
40#include <linux/fs.h> 40#include <linux/fs.h>
41#include <linux/aio.h>
42#include <linux/kdev_t.h> 41#include <linux/kdev_t.h>
43#include <linux/kthread.h> 42#include <linux/kthread.h>
44#include <linux/list.h> 43#include <linux/list.h>
@@ -48,6 +47,7 @@
48#include <linux/slab.h> 47#include <linux/slab.h>
49#include <linux/stat.h> 48#include <linux/stat.h>
50#include <linux/module.h> 49#include <linux/module.h>
50#include <linux/uio.h>
51 51
52#include "fuse_i.h" 52#include "fuse_i.h"
53 53
@@ -88,32 +88,23 @@ static struct list_head *cuse_conntbl_head(dev_t devt)
88 * FUSE file. 88 * FUSE file.
89 */ 89 */
90 90
91static ssize_t cuse_read(struct file *file, char __user *buf, size_t count, 91static ssize_t cuse_read_iter(struct kiocb *kiocb, struct iov_iter *to)
92 loff_t *ppos)
93{ 92{
93 struct fuse_io_priv io = { .async = 0, .file = kiocb->ki_filp };
94 loff_t pos = 0; 94 loff_t pos = 0;
95 struct iovec iov = { .iov_base = buf, .iov_len = count };
96 struct fuse_io_priv io = { .async = 0, .file = file };
97 struct iov_iter ii;
98 iov_iter_init(&ii, READ, &iov, 1, count);
99 95
100 return fuse_direct_io(&io, &ii, &pos, FUSE_DIO_CUSE); 96 return fuse_direct_io(&io, to, &pos, FUSE_DIO_CUSE);
101} 97}
102 98
103static ssize_t cuse_write(struct file *file, const char __user *buf, 99static ssize_t cuse_write_iter(struct kiocb *kiocb, struct iov_iter *from)
104 size_t count, loff_t *ppos)
105{ 100{
101 struct fuse_io_priv io = { .async = 0, .file = kiocb->ki_filp };
106 loff_t pos = 0; 102 loff_t pos = 0;
107 struct iovec iov = { .iov_base = (void __user *)buf, .iov_len = count };
108 struct fuse_io_priv io = { .async = 0, .file = file };
109 struct iov_iter ii;
110 iov_iter_init(&ii, WRITE, &iov, 1, count);
111
112 /* 103 /*
113 * No locking or generic_write_checks(), the server is 104 * No locking or generic_write_checks(), the server is
114 * responsible for locking and sanity checks. 105 * responsible for locking and sanity checks.
115 */ 106 */
116 return fuse_direct_io(&io, &ii, &pos, 107 return fuse_direct_io(&io, from, &pos,
117 FUSE_DIO_WRITE | FUSE_DIO_CUSE); 108 FUSE_DIO_WRITE | FUSE_DIO_CUSE);
118} 109}
119 110
@@ -186,8 +177,8 @@ static long cuse_file_compat_ioctl(struct file *file, unsigned int cmd,
186 177
187static const struct file_operations cuse_frontend_fops = { 178static const struct file_operations cuse_frontend_fops = {
188 .owner = THIS_MODULE, 179 .owner = THIS_MODULE,
189 .read = cuse_read, 180 .read_iter = cuse_read_iter,
190 .write = cuse_write, 181 .write_iter = cuse_write_iter,
191 .open = cuse_open, 182 .open = cuse_open,
192 .release = cuse_release, 183 .release = cuse_release,
193 .unlocked_ioctl = cuse_file_ioctl, 184 .unlocked_ioctl = cuse_file_ioctl,