diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-07 18:36:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-10-07 18:36:58 -0400 |
commit | d1f5323370fceaed43a7ee38f4c7bfc7e70f28d0 (patch) | |
tree | cadb1dc22207a4e1838b7af31ac3fc15363e809b /fs/gfs2/file.c | |
parent | 2eee010d092903ee95716b6c2fbd9d3289839aa4 (diff) | |
parent | a949e63992469fed87aef197347960ced31701b8 (diff) |
Merge branch 'work.splice_read' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull VFS splice updates from Al Viro:
"There's a bunch of branches this cycle, both mine and from other folks
and I'd rather send pull requests separately.
This one is the conversion of ->splice_read() to ITER_PIPE iov_iter
(and introduction of such). Gets rid of a lot of code in fs/splice.c
and elsewhere; there will be followups, but these are for the next
cycle... Some pipe/splice-related cleanups from Miklos in the same
branch as well"
* 'work.splice_read' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
pipe: fix comment in pipe_buf_operations
pipe: add pipe_buf_steal() helper
pipe: add pipe_buf_confirm() helper
pipe: add pipe_buf_release() helper
pipe: add pipe_buf_get() helper
relay: simplify relay_file_read()
switch default_file_splice_read() to use of pipe-backed iov_iter
switch generic_file_splice_read() to use of ->read_iter()
new iov_iter flavour: pipe-backed
fuse_dev_splice_read(): switch to add_to_pipe()
skb_splice_bits(): get rid of callback
new helper: add_to_pipe()
splice: lift pipe_lock out of splice_to_pipe()
splice: switch get_iovec_page_array() to iov_iter
splice_to_pipe(): don't open-code wakeup_pipe_readers()
consistent treatment of EFAULT on O_DIRECT read/write
Diffstat (limited to 'fs/gfs2/file.c')
-rw-r--r-- | fs/gfs2/file.c | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c index 360188f162bd..e23ff70b3435 100644 --- a/fs/gfs2/file.c +++ b/fs/gfs2/file.c | |||
@@ -954,30 +954,6 @@ out_uninit: | |||
954 | return ret; | 954 | return ret; |
955 | } | 955 | } |
956 | 956 | ||
957 | static ssize_t gfs2_file_splice_read(struct file *in, loff_t *ppos, | ||
958 | struct pipe_inode_info *pipe, size_t len, | ||
959 | unsigned int flags) | ||
960 | { | ||
961 | struct inode *inode = in->f_mapping->host; | ||
962 | struct gfs2_inode *ip = GFS2_I(inode); | ||
963 | struct gfs2_holder gh; | ||
964 | int ret; | ||
965 | |||
966 | inode_lock(inode); | ||
967 | |||
968 | ret = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, 0, &gh); | ||
969 | if (ret) { | ||
970 | inode_unlock(inode); | ||
971 | return ret; | ||
972 | } | ||
973 | |||
974 | gfs2_glock_dq_uninit(&gh); | ||
975 | inode_unlock(inode); | ||
976 | |||
977 | return generic_file_splice_read(in, ppos, pipe, len, flags); | ||
978 | } | ||
979 | |||
980 | |||
981 | static ssize_t gfs2_file_splice_write(struct pipe_inode_info *pipe, | 957 | static ssize_t gfs2_file_splice_write(struct pipe_inode_info *pipe, |
982 | struct file *out, loff_t *ppos, | 958 | struct file *out, loff_t *ppos, |
983 | size_t len, unsigned int flags) | 959 | size_t len, unsigned int flags) |
@@ -1140,7 +1116,7 @@ const struct file_operations gfs2_file_fops = { | |||
1140 | .fsync = gfs2_fsync, | 1116 | .fsync = gfs2_fsync, |
1141 | .lock = gfs2_lock, | 1117 | .lock = gfs2_lock, |
1142 | .flock = gfs2_flock, | 1118 | .flock = gfs2_flock, |
1143 | .splice_read = gfs2_file_splice_read, | 1119 | .splice_read = generic_file_splice_read, |
1144 | .splice_write = gfs2_file_splice_write, | 1120 | .splice_write = gfs2_file_splice_write, |
1145 | .setlease = simple_nosetlease, | 1121 | .setlease = simple_nosetlease, |
1146 | .fallocate = gfs2_fallocate, | 1122 | .fallocate = gfs2_fallocate, |
@@ -1168,7 +1144,7 @@ const struct file_operations gfs2_file_fops_nolock = { | |||
1168 | .open = gfs2_open, | 1144 | .open = gfs2_open, |
1169 | .release = gfs2_release, | 1145 | .release = gfs2_release, |
1170 | .fsync = gfs2_fsync, | 1146 | .fsync = gfs2_fsync, |
1171 | .splice_read = gfs2_file_splice_read, | 1147 | .splice_read = generic_file_splice_read, |
1172 | .splice_write = gfs2_file_splice_write, | 1148 | .splice_write = gfs2_file_splice_write, |
1173 | .setlease = generic_setlease, | 1149 | .setlease = generic_setlease, |
1174 | .fallocate = gfs2_fallocate, | 1150 | .fallocate = gfs2_fallocate, |