mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-24 19:35:58 +00:00
splice: kdoc for filemap_splice_read() and copy_splice_read()
Provide kerneldoc comments for filemap_splice_read() and copy_splice_read(). Signed-off-by: David Howells <dhowells@redhat.com> cc: Christian Brauner <brauner@kernel.org> cc: Christoph Hellwig <hch@lst.de> cc: Jens Axboe <axboe@kernel.dk> cc: Steve French <smfrench@gmail.com> cc: Al Viro <viro@zeniv.linux.org.uk> cc: linux-mm@kvack.org cc: linux-block@vger.kernel.org cc: linux-cifs@vger.kernel.org cc: linux-fsdevel@vger.kernel.org Link: https://lore.kernel.org/r/20230522135018.2742245-32-dhowells@redhat.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
3fc40265ae
commit
9eee8bd814
2 changed files with 37 additions and 5 deletions
21
fs/splice.c
21
fs/splice.c
|
@ -299,8 +299,25 @@ void splice_shrink_spd(struct splice_pipe_desc *spd)
|
||||||
kfree(spd->partial);
|
kfree(spd->partial);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Copy data from a file into pages and then splice those into the output pipe.
|
* copy_splice_read - Copy data from a file and splice the copy into a pipe
|
||||||
|
* @in: The file to read from
|
||||||
|
* @ppos: Pointer to the file position to read from
|
||||||
|
* @pipe: The pipe to splice into
|
||||||
|
* @len: The amount to splice
|
||||||
|
* @flags: The SPLICE_F_* flags
|
||||||
|
*
|
||||||
|
* This function allocates a bunch of pages sufficient to hold the requested
|
||||||
|
* amount of data (but limited by the remaining pipe capacity), passes it to
|
||||||
|
* the file's ->read_iter() to read into and then splices the used pages into
|
||||||
|
* the pipe.
|
||||||
|
*
|
||||||
|
* Return: On success, the number of bytes read will be returned and *@ppos
|
||||||
|
* will be updated if appropriate; 0 will be returned if there is no more data
|
||||||
|
* to be read; -EAGAIN will be returned if the pipe had no space, and some
|
||||||
|
* other negative error code will be returned on error. A short read may occur
|
||||||
|
* if the pipe has insufficient space, we reach the end of the data or we hit a
|
||||||
|
* hole.
|
||||||
*/
|
*/
|
||||||
ssize_t copy_splice_read(struct file *in, loff_t *ppos,
|
ssize_t copy_splice_read(struct file *in, loff_t *ppos,
|
||||||
struct pipe_inode_info *pipe,
|
struct pipe_inode_info *pipe,
|
||||||
|
|
21
mm/filemap.c
21
mm/filemap.c
|
@ -2871,9 +2871,24 @@ size_t splice_folio_into_pipe(struct pipe_inode_info *pipe,
|
||||||
return spliced;
|
return spliced;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Splice folios from the pagecache of a buffered (ie. non-O_DIRECT) file into
|
* filemap_splice_read - Splice data from a file's pagecache into a pipe
|
||||||
* a pipe.
|
* @in: The file to read from
|
||||||
|
* @ppos: Pointer to the file position to read from
|
||||||
|
* @pipe: The pipe to splice into
|
||||||
|
* @len: The amount to splice
|
||||||
|
* @flags: The SPLICE_F_* flags
|
||||||
|
*
|
||||||
|
* This function gets folios from a file's pagecache and splices them into the
|
||||||
|
* pipe. Readahead will be called as necessary to fill more folios. This may
|
||||||
|
* be used for blockdevs also.
|
||||||
|
*
|
||||||
|
* Return: On success, the number of bytes read will be returned and *@ppos
|
||||||
|
* will be updated if appropriate; 0 will be returned if there is no more data
|
||||||
|
* to be read; -EAGAIN will be returned if the pipe had no space, and some
|
||||||
|
* other negative error code will be returned on error. A short read may occur
|
||||||
|
* if the pipe has insufficient space, we reach the end of the data or we hit a
|
||||||
|
* hole.
|
||||||
*/
|
*/
|
||||||
ssize_t filemap_splice_read(struct file *in, loff_t *ppos,
|
ssize_t filemap_splice_read(struct file *in, loff_t *ppos,
|
||||||
struct pipe_inode_info *pipe,
|
struct pipe_inode_info *pipe,
|
||||||
|
|
Loading…
Reference in a new issue