This repository was archived by the owner on Nov 8, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +37
-5
lines changed Expand file tree Collapse file tree 2 files changed +37
-5
lines changed Original file line number Diff line number Diff line change @@ -299,8 +299,25 @@ void splice_shrink_spd(struct splice_pipe_desc *spd)
299
299
kfree (spd -> partial );
300
300
}
301
301
302
- /*
303
- * Copy data from a file into pages and then splice those into the output pipe.
302
+ /**
303
+ * copy_splice_read - Copy data from a file and splice the copy into a pipe
304
+ * @in: The file to read from
305
+ * @ppos: Pointer to the file position to read from
306
+ * @pipe: The pipe to splice into
307
+ * @len: The amount to splice
308
+ * @flags: The SPLICE_F_* flags
309
+ *
310
+ * This function allocates a bunch of pages sufficient to hold the requested
311
+ * amount of data (but limited by the remaining pipe capacity), passes it to
312
+ * the file's ->read_iter() to read into and then splices the used pages into
313
+ * the pipe.
314
+ *
315
+ * Return: On success, the number of bytes read will be returned and *@ppos
316
+ * will be updated if appropriate; 0 will be returned if there is no more data
317
+ * to be read; -EAGAIN will be returned if the pipe had no space, and some
318
+ * other negative error code will be returned on error. A short read may occur
319
+ * if the pipe has insufficient space, we reach the end of the data or we hit a
320
+ * hole.
304
321
*/
305
322
ssize_t copy_splice_read (struct file * in , loff_t * ppos ,
306
323
struct pipe_inode_info * pipe ,
Original file line number Diff line number Diff line change @@ -2871,9 +2871,24 @@ size_t splice_folio_into_pipe(struct pipe_inode_info *pipe,
2871
2871
return spliced ;
2872
2872
}
2873
2873
2874
- /*
2875
- * Splice folios from the pagecache of a buffered (ie. non-O_DIRECT) file into
2876
- * a pipe.
2874
+ /**
2875
+ * filemap_splice_read - Splice data from a file's pagecache into a pipe
2876
+ * @in: The file to read from
2877
+ * @ppos: Pointer to the file position to read from
2878
+ * @pipe: The pipe to splice into
2879
+ * @len: The amount to splice
2880
+ * @flags: The SPLICE_F_* flags
2881
+ *
2882
+ * This function gets folios from a file's pagecache and splices them into the
2883
+ * pipe. Readahead will be called as necessary to fill more folios. This may
2884
+ * be used for blockdevs also.
2885
+ *
2886
+ * Return: On success, the number of bytes read will be returned and *@ppos
2887
+ * will be updated if appropriate; 0 will be returned if there is no more data
2888
+ * to be read; -EAGAIN will be returned if the pipe had no space, and some
2889
+ * other negative error code will be returned on error. A short read may occur
2890
+ * if the pipe has insufficient space, we reach the end of the data or we hit a
2891
+ * hole.
2877
2892
*/
2878
2893
ssize_t filemap_splice_read (struct file * in , loff_t * ppos ,
2879
2894
struct pipe_inode_info * pipe ,
You can’t perform that action at this time.
0 commit comments