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>
This commit is contained in:
parent
8f3d9f3542
commit
2bc010600d
@ -870,8 +870,6 @@ static long do_splice_to(struct file *in, loff_t *ppos,
|
|||||||
struct pipe_inode_info *pipe, size_t len,
|
struct pipe_inode_info *pipe, size_t len,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
ssize_t (*splice_read)(struct file *, loff_t *,
|
|
||||||
struct pipe_inode_info *, size_t, unsigned int);
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (unlikely(!(in->f_mode & FMODE_READ)))
|
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;
|
len = MAX_RW_COUNT;
|
||||||
|
|
||||||
if (in->f_op->splice_read)
|
if (in->f_op->splice_read)
|
||||||
splice_read = in->f_op->splice_read;
|
return in->f_op->splice_read(in, ppos, pipe, len, flags);
|
||||||
else
|
return default_file_splice_read(in, ppos, pipe, len, flags);
|
||||||
splice_read = default_file_splice_read;
|
|
||||||
|
|
||||||
return splice_read(in, ppos, pipe, len, flags);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user