06 Oct, 2016

1 commit

  • iov_iter variant for passing data into pipe. copy_to_iter()
    copies data into page(s) it has allocated and stuffs them into
    the pipe; copy_page_to_iter() stuffs there a reference to the
    page given to it. Both will try to coalesce if possible.
    iov_iter_zero() is similar to copy_to_iter(); iov_iter_get_pages()
    and friends will do as copy_to_iter() would have and return the
    pages where the data would've been copied. iov_iter_advance()
    will truncate everything past the spot it has advanced to.

    New primitive: iov_iter_pipe(), used for initializing those.
    pipe should be locked all along.

    Running out of space acts as fault would for iovec-backed ones;
    in other words, giving it to ->read_iter() may result in short
    read if the pipe overflows, or -EFAULT if it happens with nothing
    copied there.

    In other words, ->read_iter() on those acts pretty much like
    ->splice_read(). Moreover, all generic_file_splice_read() users,
    as well as many other ->splice_read() instances can be switched
    to that scheme - that'll happen in the next commit.

    Signed-off-by: Al Viro

    Al Viro
     

04 Oct, 2016

1 commit

  • 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

    Al Viro
     

12 Jun, 2014

1 commit


28 Jan, 2014

1 commit

  • @splice_desc.total_len is 32 bit(unsigned int) which is used to store the
    size passed from userspace which is 64 bit(size_t) so that the size is
    unexpectedly truncated

    That means vmsplice can not work if the size passed from userspace is >=
    4G, for example, we noticed in vmsplice, splice-reader does not do
    anything and splice-writer is waiting for available buffer forever if the
    size is 4G

    Fix it by extending @splice_desc.total_len to 64 bits as well

    Signed-off-by: Xiao Guangrong
    Cc: Jens Axboe
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Xiao Guangrong
     

20 Jun, 2013

1 commit


14 Jun, 2012

1 commit

  • Dave Jones reported a kernel BUG at mm/slub.c:3474! triggered
    by splice_shrink_spd() called from vmsplice_to_pipe()

    commit 35f3d14dbbc5 (pipe: add support for shrinking and growing pipes)
    added capability to adjust pipe->buffers.

    Problem is some paths don't hold pipe mutex and assume pipe->buffers
    doesn't change for their duration.

    Fix this by adding nr_pages_max field in struct splice_pipe_desc, and
    use it in place of pipe->buffers where appropriate.

    splice_shrink_spd() loses its struct pipe_inode_info argument.

    Reported-by: Dave Jones
    Signed-off-by: Eric Dumazet
    Cc: Jens Axboe
    Cc: Alexander Viro
    Cc: Tom Herbert
    Cc: stable # 2.6.35
    Tested-by: Dave Jones
    Signed-off-by: Jens Axboe

    Eric Dumazet
     

26 Jul, 2011

1 commit

  • Copy __generic_file_splice_read() and generic_file_splice_read() from
    fs/splice.c to shmem_file_splice_read() in mm/shmem.c. Make
    page_cache_pipe_buf_ops and spd_release_page() accessible to it.

    Signed-off-by: Hugh Dickins
    Cc: Jens Axboe
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Hugh Dickins
     

22 May, 2010

1 commit


12 May, 2009

1 commit


15 Apr, 2009

2 commits

  • Rearrange locking of i_mutex on destination and call to
    ocfs2_rw_lock() so locks are only held while buffers are copied with
    the pipe_to_file() actor, and not while waiting for more data on the
    pipe.

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Jens Axboe

    Miklos Szeredi
     
  • Split up __splice_from_pipe() into four helper functions:

    splice_from_pipe_begin()
    splice_from_pipe_next()
    splice_from_pipe_feed()
    splice_from_pipe_end()

    splice_from_pipe_next() will wait (if necessary) for more buffers to
    be added to the pipe. splice_from_pipe_feed() will feed the buffers
    to the supplied actor and return when there's no more data available
    (or if all of the requested data has been copied).

    This is necessary so that implementations can do locking around the
    non-waiting splice_from_pipe_feed().

    This patch should not cause any change in behavior.

    Signed-off-by: Miklos Szeredi
    Signed-off-by: Jens Axboe

    Miklos Szeredi
     

29 Jan, 2008

1 commit


10 Jul, 2007

2 commits