aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/data.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-06-12 13:30:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-12 13:30:18 -0400
commit16b9057804c02e2d351e9c8f606e909b43cbd9e7 (patch)
treea3ac6e1d9d57a8abf4267e5ead3f2de1309335eb /fs/f2fs/data.c
parent5c02c392cd2320e8d612376d6b72b6548a680923 (diff)
parentc2338f2dc7c1e9f6202f370c64ffd7f44f3d4b51 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs updates from Al Viro: "This the bunch that sat in -next + lock_parent() fix. This is the minimal set; there's more pending stuff. In particular, I really hope to get acct.c fixes merged this cycle - we need that to deal sanely with delayed-mntput stuff. In the next pile, hopefully - that series is fairly short and localized (kernel/acct.c, fs/super.c and fs/namespace.c). In this pile: more iov_iter work. Most of prereqs for ->splice_write with sane locking order are there and Kent's dio rewrite would also fit nicely on top of this pile" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (70 commits) lock_parent: don't step on stale ->d_parent of all-but-freed one kill generic_file_splice_write() ceph: switch to iter_file_splice_write() shmem: switch to iter_file_splice_write() nfs: switch to iter_splice_write_file() fs/splice.c: remove unneeded exports ocfs2: switch to iter_file_splice_write() ->splice_write() via ->write_iter() bio_vec-backed iov_iter optimize copy_page_{to,from}_iter() bury generic_file_aio_{read,write} lustre: get rid of messing with iovecs ceph: switch to ->write_iter() ceph_sync_direct_write: stop poking into iov_iter guts ceph_sync_read: stop poking into iov_iter guts new helper: copy_page_from_iter() fuse: switch to ->write_iter() btrfs: switch to ->write_iter() ocfs2: switch to ->write_iter() xfs: switch to ->write_iter() ...
Diffstat (limited to 'fs/f2fs/data.c')
-rw-r--r--fs/f2fs/data.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index c1fb6dd10911..0924521306b4 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -1017,10 +1017,9 @@ static int f2fs_write_end(struct file *file,
1017} 1017}
1018 1018
1019static int check_direct_IO(struct inode *inode, int rw, 1019static int check_direct_IO(struct inode *inode, int rw,
1020 const struct iovec *iov, loff_t offset, unsigned long nr_segs) 1020 struct iov_iter *iter, loff_t offset)
1021{ 1021{
1022 unsigned blocksize_mask = inode->i_sb->s_blocksize - 1; 1022 unsigned blocksize_mask = inode->i_sb->s_blocksize - 1;
1023 int i;
1024 1023
1025 if (rw == READ) 1024 if (rw == READ)
1026 return 0; 1025 return 0;
@@ -1028,14 +1027,14 @@ static int check_direct_IO(struct inode *inode, int rw,
1028 if (offset & blocksize_mask) 1027 if (offset & blocksize_mask)
1029 return -EINVAL; 1028 return -EINVAL;
1030 1029
1031 for (i = 0; i < nr_segs; i++) 1030 if (iov_iter_alignment(iter) & blocksize_mask)
1032 if (iov[i].iov_len & blocksize_mask) 1031 return -EINVAL;
1033 return -EINVAL; 1032
1034 return 0; 1033 return 0;
1035} 1034}
1036 1035
1037static ssize_t f2fs_direct_IO(int rw, struct kiocb *iocb, 1036static ssize_t f2fs_direct_IO(int rw, struct kiocb *iocb,
1038 const struct iovec *iov, loff_t offset, unsigned long nr_segs) 1037 struct iov_iter *iter, loff_t offset)
1039{ 1038{
1040 struct file *file = iocb->ki_filp; 1039 struct file *file = iocb->ki_filp;
1041 struct inode *inode = file->f_mapping->host; 1040 struct inode *inode = file->f_mapping->host;
@@ -1044,14 +1043,14 @@ static ssize_t f2fs_direct_IO(int rw, struct kiocb *iocb,
1044 if (f2fs_has_inline_data(inode)) 1043 if (f2fs_has_inline_data(inode))
1045 return 0; 1044 return 0;
1046 1045
1047 if (check_direct_IO(inode, rw, iov, offset, nr_segs)) 1046 if (check_direct_IO(inode, rw, iter, offset))
1048 return 0; 1047 return 0;
1049 1048
1050 /* clear fsync mark to recover these blocks */ 1049 /* clear fsync mark to recover these blocks */
1051 fsync_mark_clear(F2FS_SB(inode->i_sb), inode->i_ino); 1050 fsync_mark_clear(F2FS_SB(inode->i_sb), inode->i_ino);
1052 1051
1053 return blockdev_direct_IO(rw, iocb, inode, iov, offset, nr_segs, 1052 return blockdev_direct_IO(rw, iocb, inode, iter, offset,
1054 get_data_block); 1053 get_data_block);
1055} 1054}
1056 1055
1057static void f2fs_invalidate_data_page(struct page *page, unsigned int offset, 1056static void f2fs_invalidate_data_page(struct page *page, unsigned int offset,