diff options
author | David Howells <dhowells@redhat.com> | 2023-02-14 16:01:42 +0100 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2023-02-21 00:25:43 +0100 |
commit | 07073eb01c5f630344bc1c3e56b0e0d94aedf919 (patch) | |
tree | c7580c7fd9e188c26bcb8b0d618a345036224639 /mm/internal.h | |
parent | mm: Pass info, not iter, into filemap_get_pages() (diff) | |
download | linux-07073eb01c5f630344bc1c3e56b0e0d94aedf919.tar.xz linux-07073eb01c5f630344bc1c3e56b0e0d94aedf919.zip |
splice: Add a func to do a splice from a buffered file without ITER_PIPE
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: David Howells <dhowells@redhat.com>
Reviewed-by: Jens 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: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'mm/internal.h')
-rw-r--r-- | mm/internal.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mm/internal.h b/mm/internal.h index bcf75a8b032d..6d4ca98f3844 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -795,6 +795,12 @@ struct migration_target_control { }; /* + * mm/filemap.c + */ +size_t splice_folio_into_pipe(struct pipe_inode_info *pipe, + struct folio *folio, loff_t fpos, size_t size); + +/* * mm/vmalloc.c */ #ifdef CONFIG_MMU |