fuse_file_aio_read(): convert to ->read_iter()
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 2 Apr 2014 18:47:09 +0000 (14:47 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 6 May 2014 21:37:57 +0000 (17:37 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/fuse/file.c

index 66d2d5de19d21420f23a1848f2587a5407a6945c..a25fa9059faa85b0883e231cc426af159f9e6091 100644 (file)
@@ -933,8 +933,7 @@ out:
        return err;
 }
 
-static ssize_t fuse_file_aio_read(struct kiocb *iocb, const struct iovec *iov,
-                                 unsigned long nr_segs, loff_t pos)
+static ssize_t fuse_file_read_iter(struct kiocb *iocb, struct iov_iter *to)
 {
        struct inode *inode = iocb->ki_filp->f_mapping->host;
        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,
         * i_size is up to date).
         */
        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;
                err = fuse_update_attributes(inode, NULL, iocb->ki_filp, NULL);
                if (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,
@@ -3038,8 +3037,8 @@ out:
 
 static const struct file_operations fuse_file_operations = {
        .llseek         = fuse_file_llseek,
-       .read           = do_sync_read,
-       .aio_read       = fuse_file_aio_read,
+       .read           = new_sync_read,
+       .read_iter      = fuse_file_read_iter,
        .write          = do_sync_write,
        .aio_write      = fuse_file_aio_write,
        .mmap           = fuse_file_mmap,