summaryrefslogtreecommitdiffstats
path: root/fs/block_dev.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-04-03 02:02:21 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2014-05-06 23:37:59 +0200
commita886038baa48a17f2cf77fb5dcc204fd28659d8f (patch)
tree29793657ab020f0d596a61314b56fc265da88cd9 /fs/block_dev.c
parentshmem: switch to ->read_iter() (diff)
downloadlinux-a886038baa48a17f2cf77fb5dcc204fd28659d8f.tar.xz
linux-a886038baa48a17f2cf77fb5dcc204fd28659d8f.zip
fs/block_dev.c: switch to ->read_iter()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/block_dev.c')
-rw-r--r--fs/block_dev.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c
index b140badb8184..3d97f4a257ff 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -1532,23 +1532,19 @@ ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov,
}
EXPORT_SYMBOL_GPL(blkdev_aio_write);
-static ssize_t blkdev_aio_read(struct kiocb *iocb, const struct iovec *iov,
- unsigned long nr_segs, loff_t pos)
+static ssize_t blkdev_read_iter(struct kiocb *iocb, struct iov_iter *to)
{
struct file *file = iocb->ki_filp;
struct inode *bd_inode = file->f_mapping->host;
loff_t size = i_size_read(bd_inode);
- size_t count = iocb->ki_nbytes;
- struct iov_iter to;
-
- iov_iter_init(&to, READ, iov, nr_segs, count);
+ loff_t pos = iocb->ki_pos;
if (pos >= size)
return 0;
size -= pos;
- iov_iter_truncate(&to, size);
- return generic_file_read_iter(iocb, &to);
+ iov_iter_truncate(to, size);
+ return generic_file_read_iter(iocb, to);
}
/*
@@ -1580,9 +1576,9 @@ const struct file_operations def_blk_fops = {
.open = blkdev_open,
.release = blkdev_close,
.llseek = block_llseek,
- .read = do_sync_read,
+ .read = new_sync_read,
.write = do_sync_write,
- .aio_read = blkdev_aio_read,
+ .read_iter = blkdev_read_iter,
.aio_write = blkdev_aio_write,
.mmap = generic_file_mmap,
.fsync = blkdev_fsync,