Commit 37c20f16 authored by Al Viro's avatar Al Viro

fuse_file_aio_read(): convert to ->read_iter()

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 3cd9ad5a
...@@ -933,8 +933,7 @@ static int fuse_readpages(struct file *file, struct address_space *mapping, ...@@ -933,8 +933,7 @@ static int fuse_readpages(struct file *file, struct address_space *mapping,
return err; return err;
} }
static ssize_t fuse_file_aio_read(struct kiocb *iocb, const struct iovec *iov, static ssize_t fuse_file_read_iter(struct kiocb *iocb, struct iov_iter *to)
unsigned long nr_segs, loff_t pos)
{ {
struct inode *inode = iocb->ki_filp->f_mapping->host; struct inode *inode = iocb->ki_filp->f_mapping->host;
struct fuse_conn *fc = get_fuse_conn(inode); struct fuse_conn *fc = get_fuse_conn(inode);
...@@ -945,14 +944,14 @@ static ssize_t fuse_file_aio_read(struct kiocb *iocb, const struct iovec *iov, ...@@ -945,14 +944,14 @@ static ssize_t fuse_file_aio_read(struct kiocb *iocb, const struct iovec *iov,
* i_size is up to date). * i_size is up to date).
*/ */
if (fc->auto_inval_data || if (fc->auto_inval_data ||
(pos + iov_length(iov, nr_segs) > i_size_read(inode))) { (iocb->ki_pos + iov_iter_count(to) > i_size_read(inode))) {
int err; int err;
err = fuse_update_attributes(inode, NULL, iocb->ki_filp, NULL); err = fuse_update_attributes(inode, NULL, iocb->ki_filp, NULL);
if (err) if (err)
return err; return err;
} }
return generic_file_aio_read(iocb, iov, nr_segs, pos); return generic_file_read_iter(iocb, to);
} }
static void fuse_write_fill(struct fuse_req *req, struct fuse_file *ff, static void fuse_write_fill(struct fuse_req *req, struct fuse_file *ff,
...@@ -3038,8 +3037,8 @@ static long fuse_file_fallocate(struct file *file, int mode, loff_t offset, ...@@ -3038,8 +3037,8 @@ static long fuse_file_fallocate(struct file *file, int mode, loff_t offset,
static const struct file_operations fuse_file_operations = { static const struct file_operations fuse_file_operations = {
.llseek = fuse_file_llseek, .llseek = fuse_file_llseek,
.read = do_sync_read, .read = new_sync_read,
.aio_read = fuse_file_aio_read, .read_iter = fuse_file_read_iter,
.write = do_sync_write, .write = do_sync_write,
.aio_write = fuse_file_aio_write, .aio_write = fuse_file_aio_write,
.mmap = fuse_file_mmap, .mmap = fuse_file_mmap,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment