aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/data.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/f2fs/data.c')
-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 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
994static int check_direct_IO(struct inode *inode, int rw, 994static 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,