summaryrefslogtreecommitdiff
path: root/fs/block_dev.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-04-03 03:21:50 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2014-05-06 17:38:01 -0400
commit1456c0a87c4241d3a801651019e66983c69ad17d (patch)
tree2e475b88151d625d22967324e6310ff4309ef731 /fs/block_dev.c
parent8174202b34c30e0c07231bf63f18ab29af634f0b (diff)
blkdev_aio_write() - turn into blkdev_write_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 3d97f4a257ff..4e36b8ea8aa4 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -1509,28 +1509,24 @@ static long block_ioctl(struct file *file, unsigned cmd, unsigned long arg)
* Does not take i_mutex for the write and thus is not for general purpose
* use.
*/
-ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov,
- unsigned long nr_segs, loff_t pos)
+ssize_t blkdev_write_iter(struct kiocb *iocb, struct iov_iter *from)
{
struct file *file = iocb->ki_filp;
struct blk_plug plug;
ssize_t ret;
- BUG_ON(iocb->ki_pos != pos);
-
blk_start_plug(&plug);
- ret = __generic_file_aio_write(iocb, iov, nr_segs);
+ ret = __generic_file_write_iter(iocb, from);
if (ret > 0) {
ssize_t err;
-
- err = generic_write_sync(file, pos, ret);
+ err = generic_write_sync(file, iocb->ki_pos - ret, ret);
if (err < 0)
ret = err;
}
blk_finish_plug(&plug);
return ret;
}
-EXPORT_SYMBOL_GPL(blkdev_aio_write);
+EXPORT_SYMBOL_GPL(blkdev_write_iter);
static ssize_t blkdev_read_iter(struct kiocb *iocb, struct iov_iter *to)
{
@@ -1577,9 +1573,9 @@ const struct file_operations def_blk_fops = {
.release = blkdev_close,
.llseek = block_llseek,
.read = new_sync_read,
- .write = do_sync_write,
+ .write = new_sync_write,
.read_iter = blkdev_read_iter,
- .aio_write = blkdev_aio_write,
+ .write_iter = blkdev_write_iter,
.mmap = generic_file_mmap,
.fsync = blkdev_fsync,
.unlocked_ioctl = block_ioctl,