Skip to content

Commit

Permalink
f2fs: switch to iov_iter_alignment()
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed May 6, 2014
1 parent c9c37e2 commit 5b46f25
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions fs/f2fs/data.c
Original file line number Diff line number Diff line change
Expand Up @@ -992,20 +992,19 @@ 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;

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;
}

Expand All @@ -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,
Expand Down

0 comments on commit 5b46f25

Please sign in to comment.