]> bbs.cooldavid.org Git - net-next-2.6.git/commit - fs/splice.c
[PATCH] splice: add optional input and output offsets
authorIngo Molnar <mingo@elte.hu>
Mon, 10 Apr 2006 13:18:58 +0000 (15:18 +0200)
committerJens Axboe <axboe@suse.de>
Mon, 10 Apr 2006 13:18:58 +0000 (15:18 +0200)
commit529565dcb1581c9a1e3f6df1c1763ca3e0f0d512
treee8069cc17f887ad86f8dee0d96640a2f19bf4112
parent3a326a2ce88e71d00ac0d133e314a3342a7709f8
[PATCH] splice: add optional input and output offsets

add optional input and output offsets to sys_splice(), for seekable file
descriptors:

 asmlinkage long sys_splice(int fd_in, loff_t __user *off_in,
                            int fd_out, loff_t __user *off_out,
                            size_t len, unsigned int flags);

semantics are straightforward: f_pos will be updated with the offset
provided by user-space, before the splice transfer is about to begin.
Providing a NULL offset pointer means the existing f_pos will be used
(and updated in situ).  Providing an offset for a pipe results in
-ESPIPE. Providing an invalid offset pointer results in -EFAULT.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Jens Axboe <axboe@suse.de>
fs/splice.c
include/linux/syscalls.h