pipe: Use a linked-list instead of a ring buffer
Use a linked-list of pipe_buffers rather than a ring, allocating them as we
need them. We cache one on pipe_inode_info struct for fast use by ordinary
pipe writes, just as we can cache a spare page.
Doing this will allow the pipe_buffer to have an integral variable-sized
bio_vec array pointing to the content of the buffer, allowing a buffer to
point to multiple folios.
Having a pipe_buffer that can point to multiple pages then allows splice to
append an entire splice segment consisting of multipe pages in a single
pipe buffer.
The pipe buffer bvec can then be passed directly to, say, sendmsg() with
MSG_SPLICE_PAGES when splicing from the pipe, allowing the socket to be a
bit more efficient.
Signed-off-by: David Howells <dhowells@redhat.com>
14 files changed