Skip to content

Commit 2bc0106

Browse files
Christoph HellwigAl Viro
authored andcommitted
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 <[email protected]> Signed-off-by: Al Viro <[email protected]>
1 parent 8f3d9f3 commit 2bc0106

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

fs/splice.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -870,8 +870,6 @@ static long do_splice_to(struct file *in, loff_t *ppos,
870870
struct pipe_inode_info *pipe, size_t len,
871871
unsigned int flags)
872872
{
873-
ssize_t (*splice_read)(struct file *, loff_t *,
874-
struct pipe_inode_info *, size_t, unsigned int);
875873
int ret;
876874

877875
if (unlikely(!(in->f_mode & FMODE_READ)))
@@ -885,11 +883,8 @@ static long do_splice_to(struct file *in, loff_t *ppos,
885883
len = MAX_RW_COUNT;
886884

887885
if (in->f_op->splice_read)
888-
splice_read = in->f_op->splice_read;
889-
else
890-
splice_read = default_file_splice_read;
891-
892-
return splice_read(in, ppos, pipe, len, flags);
886+
return in->f_op->splice_read(in, ppos, pipe, len, flags);
887+
return default_file_splice_read(in, ppos, pipe, len, flags);
893888
}
894889

895890
/**

0 commit comments

Comments
 (0)