summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-03-16 18:07:34 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2014-05-06 17:32:52 -0400
commit5b46f25ddc6edf4adff1a137d453da542c27a640 (patch)
tree15474c012da126f2f08ce03894652e21d7e4e062
parentc9c37e2e63786c595d704244cbb7d19dc5630493 (diff)
downloadop-kernel-dev-5b46f25ddc6edf4adff1a137d453da542c27a640.zip
op-kernel-dev-5b46f25ddc6edf4adff1a137d453da542c27a640.tar.gz
f2fs: switch to iov_iter_alignment()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/f2fs/data.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 151488f..1d2e7e9 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -992,10 +992,9 @@ static int f2fs_write_end(struct file *file,
}
static int check_direct_IO(struct inode *inode, int rw,
- const struct iovec *iov, loff_t offset, unsigned long nr_segs)
+ struct iov_iter *iter, loff_t offset)
{
unsigned blocksize_mask = inode->i_sb->s_blocksize - 1;
- int i;
if (rw == READ)
return 0;
@@ -1003,9 +1002,9 @@ static int check_direct_IO(struct inode *inode, int rw,
if (offset & blocksize_mask)
return -EINVAL;
- for (i = 0; i < nr_segs; i++)
- if (iov[i].iov_len & blocksize_mask)
- return -EINVAL;
+ if (iov_iter_alignment(iter) & blocksize_mask)
+ return -EINVAL;
+
return 0;
}
@@ -1019,7 +1018,7 @@ static ssize_t f2fs_direct_IO(int rw, struct kiocb *iocb,
if (f2fs_has_inline_data(inode))
return 0;
- if (check_direct_IO(inode, rw, iter->iov, offset, iter->nr_segs))
+ if (check_direct_IO(inode, rw, iter, offset))
return 0;
return blockdev_direct_IO(rw, iocb, inode, iter, offset,
OpenPOWER on IntegriCloud