diff options
author | Jens Axboe <axboe@suse.de> | 2006-03-30 08:15:30 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-30 15:28:18 -0500 |
commit | 5274f052e7b3dbd81935772eb551dfd0325dfa9d (patch) | |
tree | c79f813ec513660edb6f1e4a75cb366c6b84f53f /include/linux/fs.h | |
parent | 5d4fe2c1ce83c3e967ccc1ba3d580c1a5603a866 (diff) |
[PATCH] Introduce sys_splice() system call
This adds support for the sys_splice system call. Using a pipe as a
transport, it can connect to files or sockets (latter as output only).
From the splice.c comments:
"splice": joining two ropes together by interweaving their strands.
This is the "extended pipe" functionality, where a pipe is used as
an arbitrary in-memory buffer. Think of a pipe as a small kernel
buffer that you can use to transfer data from one end to the other.
The traditional unix read/write is extended with a "splice()" operation
that transfers data buffers to or from a pipe buffer.
Named by Larry McVoy, original implementation from Linus, extended by
Jens to support splicing to files and fixing the initial implementation
bugs.
Signed-off-by: Jens Axboe <axboe@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 408fe89498f4..20fa5f6d7269 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -1032,6 +1032,8 @@ struct file_operations { | |||
1032 | int (*check_flags)(int); | 1032 | int (*check_flags)(int); |
1033 | int (*dir_notify)(struct file *filp, unsigned long arg); | 1033 | int (*dir_notify)(struct file *filp, unsigned long arg); |
1034 | int (*flock) (struct file *, int, struct file_lock *); | 1034 | int (*flock) (struct file *, int, struct file_lock *); |
1035 | ssize_t (*splice_write)(struct inode *, struct file *, size_t, unsigned int); | ||
1036 | ssize_t (*splice_read)(struct file *, struct inode *, size_t, unsigned int); | ||
1035 | }; | 1037 | }; |
1036 | 1038 | ||
1037 | struct inode_operations { | 1039 | struct inode_operations { |
@@ -1609,6 +1611,8 @@ extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor | |||
1609 | extern void do_generic_mapping_read(struct address_space *mapping, | 1611 | extern void do_generic_mapping_read(struct address_space *mapping, |
1610 | struct file_ra_state *, struct file *, | 1612 | struct file_ra_state *, struct file *, |
1611 | loff_t *, read_descriptor_t *, read_actor_t); | 1613 | loff_t *, read_descriptor_t *, read_actor_t); |
1614 | extern ssize_t generic_file_splice_read(struct file *, struct inode *, size_t, unsigned int); | ||
1615 | extern ssize_t generic_file_splice_write(struct inode *, struct file *, size_t, unsigned int); | ||
1612 | extern void | 1616 | extern void |
1613 | file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); | 1617 | file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); |
1614 | extern ssize_t generic_file_readv(struct file *filp, const struct iovec *iov, | 1618 | extern ssize_t generic_file_readv(struct file *filp, const struct iovec *iov, |