aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2
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/gfs2
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/gfs2')
-rw-r--r--fs/gfs2/aops.c11
-rw-r--r--fs/gfs2/file.c30
2 files changed, 19 insertions, 22 deletions
diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c
index 492123cda64a..805b37fed638 100644
--- a/fs/gfs2/aops.c
+++ b/fs/gfs2/aops.c
@@ -1040,8 +1040,7 @@ static int gfs2_ok_for_dio(struct gfs2_inode *ip, int rw, loff_t offset)
1040 1040
1041 1041
1042static ssize_t gfs2_direct_IO(int rw, struct kiocb *iocb, 1042static ssize_t gfs2_direct_IO(int rw, struct kiocb *iocb,
1043 const struct iovec *iov, loff_t offset, 1043 struct iov_iter *iter, loff_t offset)
1044 unsigned long nr_segs)
1045{ 1044{
1046 struct file *file = iocb->ki_filp; 1045 struct file *file = iocb->ki_filp;
1047 struct inode *inode = file->f_mapping->host; 1046 struct inode *inode = file->f_mapping->host;
@@ -1081,7 +1080,7 @@ static ssize_t gfs2_direct_IO(int rw, struct kiocb *iocb,
1081 */ 1080 */
1082 if (mapping->nrpages) { 1081 if (mapping->nrpages) {
1083 loff_t lstart = offset & (PAGE_CACHE_SIZE - 1); 1082 loff_t lstart = offset & (PAGE_CACHE_SIZE - 1);
1084 loff_t len = iov_length(iov, nr_segs); 1083 loff_t len = iov_iter_count(iter);
1085 loff_t end = PAGE_ALIGN(offset + len) - 1; 1084 loff_t end = PAGE_ALIGN(offset + len) - 1;
1086 1085
1087 rv = 0; 1086 rv = 0;
@@ -1096,9 +1095,9 @@ static ssize_t gfs2_direct_IO(int rw, struct kiocb *iocb,
1096 truncate_inode_pages_range(mapping, lstart, end); 1095 truncate_inode_pages_range(mapping, lstart, end);
1097 } 1096 }
1098 1097
1099 rv = __blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov, 1098 rv = __blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev,
1100 offset, nr_segs, gfs2_get_block_direct, 1099 iter, offset,
1101 NULL, NULL, 0); 1100 gfs2_get_block_direct, NULL, NULL, 0);
1102out: 1101out:
1103 gfs2_glock_dq(&gh); 1102 gfs2_glock_dq(&gh);
1104 gfs2_holder_uninit(&gh); 1103 gfs2_holder_uninit(&gh);
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index 6ab0cfb2e891..4fc3a3046174 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -684,7 +684,7 @@ static int gfs2_fsync(struct file *file, loff_t start, loff_t end,
684} 684}
685 685
686/** 686/**
687 * gfs2_file_aio_write - Perform a write to a file 687 * gfs2_file_write_iter - Perform a write to a file
688 * @iocb: The io context 688 * @iocb: The io context
689 * @iov: The data to write 689 * @iov: The data to write
690 * @nr_segs: Number of @iov segments 690 * @nr_segs: Number of @iov segments
@@ -697,11 +697,9 @@ static int gfs2_fsync(struct file *file, loff_t start, loff_t end,
697 * 697 *
698 */ 698 */
699 699
700static ssize_t gfs2_file_aio_write(struct kiocb *iocb, const struct iovec *iov, 700static ssize_t gfs2_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
701 unsigned long nr_segs, loff_t pos)
702{ 701{
703 struct file *file = iocb->ki_filp; 702 struct file *file = iocb->ki_filp;
704 size_t writesize = iov_length(iov, nr_segs);
705 struct gfs2_inode *ip = GFS2_I(file_inode(file)); 703 struct gfs2_inode *ip = GFS2_I(file_inode(file));
706 int ret; 704 int ret;
707 705
@@ -709,7 +707,7 @@ static ssize_t gfs2_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
709 if (ret) 707 if (ret)
710 return ret; 708 return ret;
711 709
712 gfs2_size_hint(file, pos, writesize); 710 gfs2_size_hint(file, iocb->ki_pos, iov_iter_count(from));
713 711
714 if (file->f_flags & O_APPEND) { 712 if (file->f_flags & O_APPEND) {
715 struct gfs2_holder gh; 713 struct gfs2_holder gh;
@@ -720,7 +718,7 @@ static ssize_t gfs2_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
720 gfs2_glock_dq_uninit(&gh); 718 gfs2_glock_dq_uninit(&gh);
721 } 719 }
722 720
723 return generic_file_aio_write(iocb, iov, nr_segs, pos); 721 return generic_file_write_iter(iocb, from);
724} 722}
725 723
726static int fallocate_chunk(struct inode *inode, loff_t offset, loff_t len, 724static int fallocate_chunk(struct inode *inode, loff_t offset, loff_t len,
@@ -1058,10 +1056,10 @@ static int gfs2_flock(struct file *file, int cmd, struct file_lock *fl)
1058 1056
1059const struct file_operations gfs2_file_fops = { 1057const struct file_operations gfs2_file_fops = {
1060 .llseek = gfs2_llseek, 1058 .llseek = gfs2_llseek,
1061 .read = do_sync_read, 1059 .read = new_sync_read,
1062 .aio_read = generic_file_aio_read, 1060 .read_iter = generic_file_read_iter,
1063 .write = do_sync_write, 1061 .write = new_sync_write,
1064 .aio_write = gfs2_file_aio_write, 1062 .write_iter = gfs2_file_write_iter,
1065 .unlocked_ioctl = gfs2_ioctl, 1063 .unlocked_ioctl = gfs2_ioctl,
1066 .mmap = gfs2_mmap, 1064 .mmap = gfs2_mmap,
1067 .open = gfs2_open, 1065 .open = gfs2_open,
@@ -1070,7 +1068,7 @@ const struct file_operations gfs2_file_fops = {
1070 .lock = gfs2_lock, 1068 .lock = gfs2_lock,
1071 .flock = gfs2_flock, 1069 .flock = gfs2_flock,
1072 .splice_read = generic_file_splice_read, 1070 .splice_read = generic_file_splice_read,
1073 .splice_write = generic_file_splice_write, 1071 .splice_write = iter_file_splice_write,
1074 .setlease = gfs2_setlease, 1072 .setlease = gfs2_setlease,
1075 .fallocate = gfs2_fallocate, 1073 .fallocate = gfs2_fallocate,
1076}; 1074};
@@ -1090,17 +1088,17 @@ const struct file_operations gfs2_dir_fops = {
1090 1088
1091const struct file_operations gfs2_file_fops_nolock = { 1089const struct file_operations gfs2_file_fops_nolock = {
1092 .llseek = gfs2_llseek, 1090 .llseek = gfs2_llseek,
1093 .read = do_sync_read, 1091 .read = new_sync_read,
1094 .aio_read = generic_file_aio_read, 1092 .read_iter = generic_file_read_iter,
1095 .write = do_sync_write, 1093 .write = new_sync_write,
1096 .aio_write = gfs2_file_aio_write, 1094 .write_iter = gfs2_file_write_iter,
1097 .unlocked_ioctl = gfs2_ioctl, 1095 .unlocked_ioctl = gfs2_ioctl,
1098 .mmap = gfs2_mmap, 1096 .mmap = gfs2_mmap,
1099 .open = gfs2_open, 1097 .open = gfs2_open,
1100 .release = gfs2_release, 1098 .release = gfs2_release,
1101 .fsync = gfs2_fsync, 1099 .fsync = gfs2_fsync,
1102 .splice_read = generic_file_splice_read, 1100 .splice_read = generic_file_splice_read,
1103 .splice_write = generic_file_splice_write, 1101 .splice_write = iter_file_splice_write,
1104 .setlease = generic_setlease, 1102 .setlease = generic_setlease,
1105 .fallocate = gfs2_fallocate, 1103 .fallocate = gfs2_fallocate,
1106}; 1104};