aboutsummaryrefslogtreecommitdiffstats
path: root/fs/splice.c
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2007-06-04 03:59:47 -0400
committerJens Axboe <jens.axboe@oracle.com>2007-07-10 02:04:14 -0400
commitd6b29d7cee064f28ca097e906de7453541351095 (patch)
tree16775787df194cb45b4ac712da1c240f48cae96e /fs/splice.c
parentebf9909343392c929d9943c04f421cd42e03b530 (diff)
splice: divorce the splice structure/function definitions from the pipe header
We need to move even more stuff into the header so that folks can use the splice_to_pipe() implementation instead of open-coding a lot of pipe knowledge (see relay implementation), so move to our own header file finally. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'fs/splice.c')
-rw-r--r--fs/splice.c26
1 files changed, 5 insertions, 21 deletions
diff --git a/fs/splice.c b/fs/splice.c
index 13846f723d72..bea9f1581ca0 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -20,7 +20,7 @@
20#include <linux/fs.h> 20#include <linux/fs.h>
21#include <linux/file.h> 21#include <linux/file.h>
22#include <linux/pagemap.h> 22#include <linux/pagemap.h>
23#include <linux/pipe_fs_i.h> 23#include <linux/splice.h>
24#include <linux/mm_inline.h> 24#include <linux/mm_inline.h>
25#include <linux/swap.h> 25#include <linux/swap.h>
26#include <linux/writeback.h> 26#include <linux/writeback.h>
@@ -29,22 +29,6 @@
29#include <linux/syscalls.h> 29#include <linux/syscalls.h>
30#include <linux/uio.h> 30#include <linux/uio.h>
31 31
32struct partial_page {
33 unsigned int offset;
34 unsigned int len;
35};
36
37/*
38 * Passed to splice_to_pipe
39 */
40struct splice_pipe_desc {
41 struct page **pages; /* page map */
42 struct partial_page *partial; /* pages[] may not be contig */
43 int nr_pages; /* number of pages in map */
44 unsigned int flags; /* splice flags */
45 const struct pipe_buf_operations *ops;/* ops associated with output pipe */
46};
47
48/* 32/*
49 * Attempt to steal a page from a pipe buffer. This should perhaps go into 33 * Attempt to steal a page from a pipe buffer. This should perhaps go into
50 * a vm helper function, it's already simplified quite a bit by the 34 * a vm helper function, it's already simplified quite a bit by the
@@ -170,11 +154,11 @@ static const struct pipe_buf_operations user_page_pipe_buf_ops = {
170}; 154};
171 155
172/* 156/*
173 * Pipe output worker. This sets up our pipe format with the page cache 157 * Pipe output worker. This fills a pipe with the information contained
174 * pipe buffer operations. Otherwise very similar to the regular pipe_writev(). 158 * from splice_pipe_desc().
175 */ 159 */
176static ssize_t splice_to_pipe(struct pipe_inode_info *pipe, 160ssize_t splice_to_pipe(struct pipe_inode_info *pipe,
177 struct splice_pipe_desc *spd) 161 struct splice_pipe_desc *spd)
178{ 162{
179 unsigned int spd_pages = spd->nr_pages; 163 unsigned int spd_pages = spd->nr_pages;
180 int ret, do_wakeup, page_nr; 164 int ret, do_wakeup, page_nr;