diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-03-04 22:14:00 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-05-06 17:32:45 -0400 |
commit | 16b1f05d7f5ab4ce570963aca5f3b2b5d21822fa (patch) | |
tree | c3cb15bc1843274bc2d70759dc9007da2a83c97e /fs/ext4/indirect.c | |
parent | 619d30b4b8c488042b4a720ca79dccc346d1a516 (diff) |
ext4: switch the guts of ->direct_IO() to iov_iter
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ext4/indirect.c')
-rw-r--r-- | fs/ext4/indirect.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/fs/ext4/indirect.c b/fs/ext4/indirect.c index 594009f5f523..eb5ae16902d0 100644 --- a/fs/ext4/indirect.c +++ b/fs/ext4/indirect.c | |||
@@ -639,8 +639,7 @@ out: | |||
639 | * VFS code falls back into buffered path in that case so we are safe. | 639 | * VFS code falls back into buffered path in that case so we are safe. |
640 | */ | 640 | */ |
641 | ssize_t ext4_ind_direct_IO(int rw, struct kiocb *iocb, | 641 | ssize_t ext4_ind_direct_IO(int rw, struct kiocb *iocb, |
642 | const struct iovec *iov, loff_t offset, | 642 | struct iov_iter *iter, loff_t offset) |
643 | unsigned long nr_segs) | ||
644 | { | 643 | { |
645 | struct file *file = iocb->ki_filp; | 644 | struct file *file = iocb->ki_filp; |
646 | struct inode *inode = file->f_mapping->host; | 645 | struct inode *inode = file->f_mapping->host; |
@@ -648,7 +647,7 @@ ssize_t ext4_ind_direct_IO(int rw, struct kiocb *iocb, | |||
648 | handle_t *handle; | 647 | handle_t *handle; |
649 | ssize_t ret; | 648 | ssize_t ret; |
650 | int orphan = 0; | 649 | int orphan = 0; |
651 | size_t count = iov_length(iov, nr_segs); | 650 | size_t count = iov_length(iter->iov, iter->nr_segs); |
652 | int retries = 0; | 651 | int retries = 0; |
653 | 652 | ||
654 | if (rw == WRITE) { | 653 | if (rw == WRITE) { |
@@ -687,18 +686,18 @@ retry: | |||
687 | goto locked; | 686 | goto locked; |
688 | } | 687 | } |
689 | ret = __blockdev_direct_IO(rw, iocb, inode, | 688 | ret = __blockdev_direct_IO(rw, iocb, inode, |
690 | inode->i_sb->s_bdev, iov, | 689 | inode->i_sb->s_bdev, iter->iov, |
691 | offset, nr_segs, | 690 | offset, iter->nr_segs, |
692 | ext4_get_block, NULL, NULL, 0); | 691 | ext4_get_block, NULL, NULL, 0); |
693 | inode_dio_done(inode); | 692 | inode_dio_done(inode); |
694 | } else { | 693 | } else { |
695 | locked: | 694 | locked: |
696 | ret = blockdev_direct_IO(rw, iocb, inode, iov, | 695 | ret = blockdev_direct_IO(rw, iocb, inode, iter->iov, |
697 | offset, nr_segs, ext4_get_block); | 696 | offset, iter->nr_segs, ext4_get_block); |
698 | 697 | ||
699 | if (unlikely((rw & WRITE) && ret < 0)) { | 698 | if (unlikely((rw & WRITE) && ret < 0)) { |
700 | loff_t isize = i_size_read(inode); | 699 | loff_t isize = i_size_read(inode); |
701 | loff_t end = offset + iov_length(iov, nr_segs); | 700 | loff_t end = offset + count; |
702 | 701 | ||
703 | if (end > isize) | 702 | if (end > isize) |
704 | ext4_truncate_failed_write(inode); | 703 | ext4_truncate_failed_write(inode); |