Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5274f052 authored by Jens Axboe's avatar Jens Axboe Committed by Linus Torvalds
Browse files

[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: default avatarJens Axboe <axboe@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 5d4fe2c1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -312,3 +312,4 @@ ENTRY(sys_call_table)
	.long sys_unshare		/* 310 */
	.long sys_set_robust_list
	.long sys_get_robust_list
	.long sys_splice
+1 −0
Original line number Diff line number Diff line
@@ -1605,5 +1605,6 @@ sys_call_table:
	data8 sys_ni_syscall			// reserved for pselect
	data8 sys_ni_syscall			// 1295 reserved for ppoll
	data8 sys_unshare
	data8 sys_splice

	.org sys_call_table + 8*NR_syscalls	// guard against failures to increase NR_syscalls
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ obj-y := open.o read_write.o file_table.o buffer.o bio.o super.o \
		ioctl.o readdir.o select.o fifo.o locks.o dcache.o inode.o \
		attr.o bad_inode.o file.o filesystems.o namespace.o aio.o \
		seq_file.o xattr.o libfs.o fs-writeback.o mpage.o direct-io.o \
		ioprio.o pnode.o drop_caches.o
		ioprio.o pnode.o drop_caches.o splice.o

obj-$(CONFIG_INOTIFY)		+= inotify.o
obj-$(CONFIG_EPOLL)		+= eventpoll.o
+2 −0
Original line number Diff line number Diff line
@@ -53,6 +53,8 @@ const struct file_operations ext2_file_operations = {
	.readv		= generic_file_readv,
	.writev		= generic_file_writev,
	.sendfile	= generic_file_sendfile,
	.splice_read	= generic_file_splice_read,
	.splice_write	= generic_file_splice_write,
};

#ifdef CONFIG_EXT2_FS_XIP
+2 −0
Original line number Diff line number Diff line
@@ -119,6 +119,8 @@ const struct file_operations ext3_file_operations = {
	.release	= ext3_release_file,
	.fsync		= ext3_sync_file,
	.sendfile	= generic_file_sendfile,
	.splice_read	= generic_file_splice_read,
	.splice_write	= generic_file_splice_write,
};

struct inode_operations ext3_file_inode_operations = {
Loading