f2fs: switch to iov_iter_alignment()
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 16 Mar 2014 22:07:34 +0000 (18:07 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 6 May 2014 21:32:52 +0000 (17:32 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/f2fs/data.c

index 151488f27755282d24ee149d8df753aacf677c89..1d2e7e9624d2c4f5fc372a0f86be916169deebe4 100644 (file)
@@ -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,