summaryrefslogtreecommitdiff
path: root/fs/splice.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-05-20 18:58:10 +0300
committerAl Viro <viro@zeniv.linux.org.uk>2020-05-20 19:11:25 +0300
commit2bc010600d0a8add4470eb37e1ccca8aaa3d0070 (patch)
tree7db56fb3b3408d6a2b958bdfde8f7fa995ed2fca /fs/splice.c
parent8f3d9f354286745c751374f5f1fcafee6b3f3136 (diff)
downloadlinux-2bc010600d0a8add4470eb37e1ccca8aaa3d0070.tar.xz
fs: simplify do_splice_to
No need for a local function pointer when we can trivial branch on the ->splice_read presence. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/splice.c')
-rw-r--r--fs/splice.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/fs/splice.c b/fs/splice.c
index 4735defc46ee..77b10f45a3da 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -870,8 +870,6 @@ static long do_splice_to(struct file *in, loff_t *ppos,
struct pipe_inode_info *pipe, size_t len,
unsigned int flags)
{
- ssize_t (*splice_read)(struct file *, loff_t *,
- struct pipe_inode_info *, size_t, unsigned int);
int ret;
if (unlikely(!(in->f_mode & FMODE_READ)))
@@ -885,11 +883,8 @@ static long do_splice_to(struct file *in, loff_t *ppos,
len = MAX_RW_COUNT;
if (in->f_op->splice_read)
- splice_read = in->f_op->splice_read;
- else
- splice_read = default_file_splice_read;
-
- return splice_read(in, ppos, pipe, len, flags);
+ return in->f_op->splice_read(in, ppos, pipe, len, flags);
+ return default_file_splice_read(in, ppos, pipe, len, flags);
}
/**