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