diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-03-16 18:07:34 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-05-06 17:32:52 -0400 |
commit | 5b46f25ddc6edf4adff1a137d453da542c27a640 (patch) | |
tree | 15474c012da126f2f08ce03894652e21d7e4e062 /fs | |
parent | c9c37e2e63786c595d704244cbb7d19dc5630493 (diff) |
f2fs: switch to iov_iter_alignment()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/f2fs/data.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 151488f27755..1d2e7e9624d2 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c | |||
@@ -992,10 +992,9 @@ static int f2fs_write_end(struct file *file, | |||
992 | } | 992 | } |
993 | 993 | ||
994 | static int check_direct_IO(struct inode *inode, int rw, | 994 | static int check_direct_IO(struct inode *inode, int rw, |
995 | const struct iovec *iov, loff_t offset, unsigned long nr_segs) | 995 | struct iov_iter *iter, loff_t offset) |
996 | { | 996 | { |
997 | unsigned blocksize_mask = inode->i_sb->s_blocksize - 1; | 997 | unsigned blocksize_mask = inode->i_sb->s_blocksize - 1; |
998 | int i; | ||
999 | 998 | ||
1000 | if (rw == READ) | 999 | if (rw == READ) |
1001 | return 0; | 1000 | return 0; |
@@ -1003,9 +1002,9 @@ static int check_direct_IO(struct inode *inode, int rw, | |||
1003 | if (offset & blocksize_mask) | 1002 | if (offset & blocksize_mask) |
1004 | return -EINVAL; | 1003 | return -EINVAL; |
1005 | 1004 | ||
1006 | for (i = 0; i < nr_segs; i++) | 1005 | if (iov_iter_alignment(iter) & blocksize_mask) |
1007 | if (iov[i].iov_len & blocksize_mask) | 1006 | return -EINVAL; |
1008 | return -EINVAL; | 1007 | |
1009 | return 0; | 1008 | return 0; |
1010 | } | 1009 | } |
1011 | 1010 | ||
@@ -1019,7 +1018,7 @@ static ssize_t f2fs_direct_IO(int rw, struct kiocb *iocb, | |||
1019 | if (f2fs_has_inline_data(inode)) | 1018 | if (f2fs_has_inline_data(inode)) |
1020 | return 0; | 1019 | return 0; |
1021 | 1020 | ||
1022 | if (check_direct_IO(inode, rw, iter->iov, offset, iter->nr_segs)) | 1021 | if (check_direct_IO(inode, rw, iter, offset)) |
1023 | return 0; | 1022 | return 0; |
1024 | 1023 | ||
1025 | return blockdev_direct_IO(rw, iocb, inode, iter, offset, | 1024 | return blockdev_direct_IO(rw, iocb, inode, iter, offset, |