[PATCH] Add support for the sys_vmsplice syscall
sys_splice() moves data to/from pipes with a file input/output. sys_vmsplice() moves data to a pipe, with the input being a user address range instead. This uses an approach suggested by Linus, where we can hold partial ranges inside the pages[] map. Hopefully this will be useful for network receive support as well. Signed-off-by: Jens Axboe <axboe@suse.de>
This commit is contained in:
@@ -321,8 +321,9 @@
|
||||
#define __NR_splice 313
|
||||
#define __NR_sync_file_range 314
|
||||
#define __NR_tee 315
|
||||
#define __NR_vmsplice 316
|
||||
|
||||
#define NR_syscalls 316
|
||||
#define NR_syscalls 317
|
||||
|
||||
/*
|
||||
* user-visible error numbers are in the range -1 - -128: see
|
||||
|
||||
@@ -290,12 +290,13 @@
|
||||
#define __NR_get_robust_list 1299
|
||||
#define __NR_sync_file_range 1300
|
||||
#define __NR_tee 1301
|
||||
#define __NR_vmsplice 1302
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/config.h>
|
||||
|
||||
#define NR_syscalls 278 /* length of syscall table */
|
||||
#define NR_syscalls 279 /* length of syscall table */
|
||||
|
||||
#define __ARCH_WANT_SYS_RT_SIGACTION
|
||||
|
||||
|
||||
@@ -303,8 +303,9 @@
|
||||
#define __NR_unshare 282
|
||||
#define __NR_splice 283
|
||||
#define __NR_tee 284
|
||||
#define __NR_vmsplice 285
|
||||
|
||||
#define __NR_syscalls 285
|
||||
#define __NR_syscalls 286
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#define __NR__exit __NR_exit
|
||||
|
||||
@@ -615,8 +615,10 @@ __SYSCALL(__NR_splice, sys_splice)
|
||||
__SYSCALL(__NR_tee, sys_tee)
|
||||
#define __NR_sync_file_range 277
|
||||
__SYSCALL(__NR_sync_file_range, sys_sync_file_range)
|
||||
#define __NR_vmsplice 278
|
||||
__SYSCALL(__NR_vmsplice, sys_vmsplice)
|
||||
|
||||
#define __NR_syscall_max __NR_sync_file_range
|
||||
#define __NR_syscall_max __NR_vmsplice
|
||||
|
||||
#ifndef __NO_STUBS
|
||||
|
||||
|
||||
@@ -574,6 +574,9 @@ 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);
|
||||
|
||||
asmlinkage long sys_vmsplice(int fd, const struct iovec __user *iov,
|
||||
unsigned long nr_segs, unsigned int flags);
|
||||
|
||||
asmlinkage long sys_tee(int fdin, int fdout, size_t len, unsigned int flags);
|
||||
|
||||
asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes,
|
||||
|
||||
Reference in New Issue
Block a user