• David Howells's avatar
    splice: Add a func to do a splice from a buffered file without ITER_PIPE · 07073eb0
    David Howells authored
    Provide a function to do splice read from a buffered file, pulling the
    folios out of the pagecache directly by calling filemap_get_pages() to do
    any required reading and then pasting the returned folios into the pipe.
    
    A helper function is provided to do the actual folio pasting and will
    handle multipage folios by splicing as many of the relevant subpages as
    will fit into the pipe.
    
    The code is loosely based on filemap_read() and might belong in
    mm/filemap.c with that as it needs to use filemap_get_pages().
    Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
    Reviewed-by: default avatarJens Axboe <axboe@kernel.dk>
    cc: Christoph Hellwig <hch@lst.de>
    cc: Al Viro <viro@zeniv.linux.org.uk>
    cc: David Hildenbrand <david@redhat.com>
    cc: John Hubbard <jhubbard@nvidia.com>
    cc: linux-mm@kvack.org
    cc: linux-block@vger.kernel.org
    cc: linux-fsdevel@vger.kernel.org
    Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
    07073eb0
filemap.c 115 KB