[PATCH 06/12] new helper: add_to_pipe()
Miklos Szeredi
miklos at szeredi.hu
Mon Sep 26 08:49:16 CDT 2016
On Sat, Sep 24, 2016 at 6:00 AM, Al Viro <viro at zeniv.linux.org.uk> wrote:
> single-buffer analogue of splice_to_pipe(); vmsplice_to_pipe() switched
> to that, leaving splice_to_pipe() only for ->splice_read() instances
> (and that only until they are converted as well).
>
> Signed-off-by: Al Viro <viro at zeniv.linux.org.uk>
> ---
> fs/splice.c | 113 ++++++++++++++++++++++++++++---------------------
> include/linux/splice.h | 2 +
> 2 files changed, 67 insertions(+), 48 deletions(-)
>
[...]
> @@ -1523,26 +1553,13 @@ static long vmsplice_to_pipe(struct file *file, const struct iovec __user *uiov,
> if (ret < 0)
> return ret;
>
> - if (splice_grow_spd(pipe, &spd)) {
> - kfree(iov);
> - return -ENOMEM;
> - }
> -
> pipe_lock(pipe);
> ret = wait_for_space(pipe, flags);
> - if (!ret) {
> - spd.nr_pages = get_iovec_page_array(&from, spd.pages,
> - spd.partial,
> - spd.nr_pages_max);
> - if (spd.nr_pages <= 0)
> - ret = spd.nr_pages;
> - else
> - ret = splice_to_pipe(pipe, &spd);
> - pipe_unlock(pipe);
> - if (ret > 0)
> - wakeup_pipe_readers(pipe);
> - }
> - splice_shrink_spd(&spd);
> + if (!ret)
> + ret = iter_to_pipe(&from, pipe, buf_flag);
> + pipe_unlock(pipe);
Ah, here it is :)
Thanks,
Miklos
More information about the xfs
mailing list