diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-12 13:30:18 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-12 13:30:18 -0400 |
commit | 16b9057804c02e2d351e9c8f606e909b43cbd9e7 (patch) | |
tree | a3ac6e1d9d57a8abf4267e5ead3f2de1309335eb /fs/gfs2/file.c | |
parent | 5c02c392cd2320e8d612376d6b72b6548a680923 (diff) | |
parent | c2338f2dc7c1e9f6202f370c64ffd7f44f3d4b51 (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/file.c')
-rw-r--r-- | fs/gfs2/file.c | 30 |
1 files changed, 14 insertions, 16 deletions
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 | ||
700 | static ssize_t gfs2_file_aio_write(struct kiocb *iocb, const struct iovec *iov, | 700 | static 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 | ||
726 | static int fallocate_chunk(struct inode *inode, loff_t offset, loff_t len, | 724 | static 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 | ||
1059 | const struct file_operations gfs2_file_fops = { | 1057 | const 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 | ||
1091 | const struct file_operations gfs2_file_fops_nolock = { | 1089 | const 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 | }; |