diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-04-03 14:20:23 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-05-06 17:39:40 -0400 |
commit | bf97f3bc0c32140c43fe5ca53d23514ea46a54ca (patch) | |
tree | 2fb0b36ec974019e019c88dc42678a109b825902 /fs/xfs | |
parent | 50b5551d1719c8bce60c6d4027b814cfc72c2307 (diff) |
xfs: switch to ->write_iter()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/xfs_file.c | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index a1acd2fa57e8..5446e86d3485 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c | |||
@@ -748,38 +748,29 @@ out: | |||
748 | } | 748 | } |
749 | 749 | ||
750 | STATIC ssize_t | 750 | STATIC ssize_t |
751 | xfs_file_aio_write( | 751 | xfs_file_write_iter( |
752 | struct kiocb *iocb, | 752 | struct kiocb *iocb, |
753 | const struct iovec *iovp, | 753 | struct iov_iter *from) |
754 | unsigned long nr_segs, | ||
755 | loff_t pos) | ||
756 | { | 754 | { |
757 | struct file *file = iocb->ki_filp; | 755 | struct file *file = iocb->ki_filp; |
758 | struct address_space *mapping = file->f_mapping; | 756 | struct address_space *mapping = file->f_mapping; |
759 | struct inode *inode = mapping->host; | 757 | struct inode *inode = mapping->host; |
760 | struct xfs_inode *ip = XFS_I(inode); | 758 | struct xfs_inode *ip = XFS_I(inode); |
761 | ssize_t ret; | 759 | ssize_t ret; |
762 | size_t ocount = 0; | 760 | size_t ocount = iov_iter_count(from); |
763 | struct iov_iter from; | ||
764 | 761 | ||
765 | XFS_STATS_INC(xs_write_calls); | 762 | XFS_STATS_INC(xs_write_calls); |
766 | 763 | ||
767 | BUG_ON(iocb->ki_pos != pos); | ||
768 | |||
769 | ocount = iov_length(iovp, nr_segs); | ||
770 | if (ocount == 0) | 764 | if (ocount == 0) |
771 | return 0; | 765 | return 0; |
772 | iov_iter_init(&from, WRITE, iovp, nr_segs, ocount); | ||
773 | 766 | ||
774 | if (XFS_FORCED_SHUTDOWN(ip->i_mount)) { | 767 | if (XFS_FORCED_SHUTDOWN(ip->i_mount)) |
775 | ret = -EIO; | 768 | return -EIO; |
776 | goto out; | ||
777 | } | ||
778 | 769 | ||
779 | if (unlikely(file->f_flags & O_DIRECT)) | 770 | if (unlikely(file->f_flags & O_DIRECT)) |
780 | ret = xfs_file_dio_aio_write(iocb, &from); | 771 | ret = xfs_file_dio_aio_write(iocb, from); |
781 | else | 772 | else |
782 | ret = xfs_file_buffered_aio_write(iocb, &from); | 773 | ret = xfs_file_buffered_aio_write(iocb, from); |
783 | 774 | ||
784 | if (ret > 0) { | 775 | if (ret > 0) { |
785 | ssize_t err; | 776 | ssize_t err; |
@@ -791,8 +782,6 @@ xfs_file_aio_write( | |||
791 | if (err < 0) | 782 | if (err < 0) |
792 | ret = err; | 783 | ret = err; |
793 | } | 784 | } |
794 | |||
795 | out: | ||
796 | return ret; | 785 | return ret; |
797 | } | 786 | } |
798 | 787 | ||
@@ -1449,9 +1438,9 @@ xfs_file_llseek( | |||
1449 | const struct file_operations xfs_file_operations = { | 1438 | const struct file_operations xfs_file_operations = { |
1450 | .llseek = xfs_file_llseek, | 1439 | .llseek = xfs_file_llseek, |
1451 | .read = new_sync_read, | 1440 | .read = new_sync_read, |
1452 | .write = do_sync_write, | 1441 | .write = new_sync_write, |
1453 | .read_iter = xfs_file_read_iter, | 1442 | .read_iter = xfs_file_read_iter, |
1454 | .aio_write = xfs_file_aio_write, | 1443 | .write_iter = xfs_file_write_iter, |
1455 | .splice_read = xfs_file_splice_read, | 1444 | .splice_read = xfs_file_splice_read, |
1456 | .splice_write = xfs_file_splice_write, | 1445 | .splice_write = xfs_file_splice_write, |
1457 | .unlocked_ioctl = xfs_file_ioctl, | 1446 | .unlocked_ioctl = xfs_file_ioctl, |