diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2012-04-04 05:08:51 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2012-04-20 04:20:05 -0400 |
commit | bd1a68b59c8e3bce45fb76632c64e1e063c3962d (patch) | |
tree | 20ee27961256383e8eccb8236f901315623383f9 /fs/splice.c | |
parent | a637120e49021d197e9578cba545bbaa459cbb51 (diff) |
vmsplice: relax alignement requirements for SPLICE_F_GIFT
It seems there is no fundamental reason to limit vmsplice()
SPLICE_F_GIFT to page aligned chunks.
All helpers are prepared to cope with offsets in page.
This limitation makes vmsplice() API very impractical in the zero-copy
land.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Tom Herbert <therbert@google.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: David Miller <davem@davemloft.net>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Hugh Dickins <hughd@google.com>
Cc: Changli Gao <xiaosuo@gmail.com>
Cc: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/splice.c')
-rw-r--r-- | fs/splice.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/splice.c b/fs/splice.c index 5f883de7ef3a..5417aa320dc7 100644 --- a/fs/splice.c +++ b/fs/splice.c | |||
@@ -1385,7 +1385,7 @@ static long do_splice(struct file *in, loff_t __user *off_in, | |||
1385 | */ | 1385 | */ |
1386 | static int get_iovec_page_array(const struct iovec __user *iov, | 1386 | static int get_iovec_page_array(const struct iovec __user *iov, |
1387 | unsigned int nr_vecs, struct page **pages, | 1387 | unsigned int nr_vecs, struct page **pages, |
1388 | struct partial_page *partial, int aligned, | 1388 | struct partial_page *partial, bool aligned, |
1389 | unsigned int pipe_buffers) | 1389 | unsigned int pipe_buffers) |
1390 | { | 1390 | { |
1391 | int buffers = 0, error = 0; | 1391 | int buffers = 0, error = 0; |
@@ -1623,7 +1623,7 @@ static long vmsplice_to_pipe(struct file *file, const struct iovec __user *iov, | |||
1623 | return -ENOMEM; | 1623 | return -ENOMEM; |
1624 | 1624 | ||
1625 | spd.nr_pages = get_iovec_page_array(iov, nr_segs, spd.pages, | 1625 | spd.nr_pages = get_iovec_page_array(iov, nr_segs, spd.pages, |
1626 | spd.partial, flags & SPLICE_F_GIFT, | 1626 | spd.partial, false, |
1627 | pipe->buffers); | 1627 | pipe->buffers); |
1628 | if (spd.nr_pages <= 0) | 1628 | if (spd.nr_pages <= 0) |
1629 | ret = spd.nr_pages; | 1629 | ret = spd.nr_pages; |