/* Attempt to initiate a splice from pipe to file.  */
static long do_splice_from(struct pipe_inode_info *pipe, struct file *out, loff_t *ppos, size_t len, unsigned int flags)
/* Attempt to initiate a splice from pipe to file.  */
static long do_splice_from(struct pipe_inode_info *pipe, struct file *out, loff_t *ppos, size_t len, unsigned int flags)
{
	ssize_t (*splice_write)(struct pipe_inode_info *, struct file *,
				loff_t *, size_t, unsigned int);
	int ret;
	if (unlikely(!(out->f_mode & FMODE_WRITE)))
		return -EBADF;
	if (unlikely(out->f_flags & O_APPEND))
		return -EINVAL;
	ret = rw_verify_area(WRITE, out, ppos, len);
	if (unlikely(ret < 0))
		return ret;
	if (out->f_op && out->f_op->splice_write)
		splice_write = out->f_op->splice_write;
	else
		splice_write = default_file_splice_write;
	return splice_write(pipe, out, ppos, len, flags);
}