moved sendfile syscall to splice translation unit
Subsystems (45)
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/56 moved sendfile syscall to splice translation unit
sendfile functionally forms part of the splice group of syscalls (splice, vmsplice and tee). Grouping sendfile with splice paves the way to compiling out the splice group of syscalls for embedded systems that do not need these.
add/remove: 0/0 grow/shrink: 7/2 up/down: 86/-61 (25)
function old new delta
file_start_write 34 68 +34 file_end_write 29 58 +29 sys_pwritev 115 122 +7 sys_preadv 115 122 +7 fdput_pos 29 36 +7 sys_pwrite64 115 116 +1 sys_pread64 115 116 +1 sys_tee 497 491 -6
sys_splice 1075 1020 -55
--- fs/read_write.c | 175 ------------------------------------------------------- fs/splice.c | 178 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 178 insertions(+), 175 deletions(-)
fs/read_write.c +0 -175
@@ -1189,178 +1189,3 @@ COMPAT_SYSCALL_DEFINE5(pwritev, compat_ulong_t, fd, }#endif -static ssize_t do_sendfile (int out_fd,int in_fd,loff_t *ppos, -size_t count,loff_t max) -{ -struct fd in, out; -struct inode *in_inode, *out_inode; -loff_t pos; -loff_t out_pos; -ssize_t retval; -int fl; - -/* -* Get input file, and verify that it is ok.. -*/ - retval = -EBADF ; - in =fdget (in_fd); -if (!in.file) - goto out; -if (!(in.file->f_mode &FMODE_READ )) - goto fput_in; - retval = -ESPIPE ; -if (!ppos) { - pos = in.file->f_pos; - }else { - pos = *ppos; -if (!(in.file->f_mode &FMODE_PREAD )) - goto fput_in; - } - retval =rw_verify_area (READ , in.file, &pos, count); -if (retval <0 ) - goto fput_in; - count = retval; - -/* -* Get output file, and verify that it is ok.. -*/ - retval = -EBADF ; - out =fdget (out_fd); -if (!out.file) - goto fput_in; -if (!(out.file->f_mode &FMODE_WRITE )) - goto fput_out; - retval = -EINVAL ; - in_inode =file_inode (in.file); - out_inode =file_inode (out.file); - out_pos = out.file->f_pos; - retval =rw_verify_area (WRITE , out.file, &out_pos, count); -if (retval <0 ) - goto fput_out; - count = retval; - -if (!max) - max =min (in_inode->i_sb->s_maxbytes, out_inode->i_sb->s_maxbytes); - -if (unlikely (pos + count > max)) { - retval = -EOVERFLOW ; -if (pos >= max) - goto fput_out; - count = max - pos; - } - - fl =0 ; -#if 0 -/* -* We need to debate whether we can enable this or not. The -* man page documents EAGAIN return for the output at least, -* and the application is arguably buggy if it doesn't expect -* EAGAIN on a non-blocking file descriptor. -*/ -if (in.file->f_flags &O_NONBLOCK ) - fl =SPLICE_F_NONBLOCK ; -#endif -file_start_write (out.file); - retval =do_splice_direct (in.file, &pos, out.file, &out_pos, count, fl); -file_end_write (out.file); - -if (retval >0 ) { -add_rchar (current, retval); -add_wchar (current, retval); -fsnotify_access (in.file); -fsnotify_modify (out.file); - out.file->f_pos = out_pos; -if (ppos) - *ppos = pos; -else - in.file->f_pos = pos; - } - -inc_syscr (current); -inc_syscw (current); -if (pos > max) - retval = -EOVERFLOW ; - -fput_out: -fdput (out); -fput_in: -fdput (in); -out: -return retval; -} - -SYSCALL_DEFINE4(sendfile, int, out_fd, int, in_fd, off_t __user *, offset, size_t, count) -{ -loff_t pos; -off_t off; -ssize_t ret; - -if (offset) { -if (unlikely (get_user (off, offset))) -return -EFAULT ; - pos = off; - ret =do_sendfile (out_fd, in_fd, &pos, count,MAX_NON_LFS ); -if (unlikely (put_user (pos, offset))) -return -EFAULT ; -return ret; - } - -return do_sendfile (out_fd, in_fd,NULL , count,0 ); -} - -SYSCALL_DEFINE4(sendfile64, int, out_fd, int, in_fd, loff_t __user *, offset, size_t, count) -{ -loff_t pos; -ssize_t ret; - -if (offset) { -if (unlikely (copy_from_user (&pos, offset,sizeof (loff_t)))) -return -EFAULT ; - ret =do_sendfile (out_fd, in_fd, &pos, count,0 ); -if (unlikely (put_user (pos, offset))) -return -EFAULT ; -return ret; - } - -return do_sendfile (out_fd, in_fd,NULL , count,0 ); -} - -#ifdef CONFIG_COMPAT -COMPAT_SYSCALL_DEFINE4 (sendfile, int, out_fd, int, in_fd, - compat_off_t __user *, offset, compat_size_t, count) -{ -loff_t pos; -off_t off; -ssize_t ret; - -if (offset) { -if (unlikely (get_user (off, offset))) -return -EFAULT ; - pos = off; - ret =do_sendfile (out_fd, in_fd, &pos, count,MAX_NON_LFS ); -if (unlikely (put_user (pos, offset))) -return -EFAULT ; -return ret; - } - -return do_sendfile (out_fd, in_fd,NULL , count,0 ); -} - -COMPAT_SYSCALL_DEFINE4 (sendfile64, int, out_fd, int, in_fd, - compat_loff_t __user *, offset, compat_size_t, count) -{ -loff_t pos; -ssize_t ret; - -if (offset) { -if (unlikely (copy_from_user (&pos, offset,sizeof (loff_t)))) -return -EFAULT ; - ret =do_sendfile (out_fd, in_fd, &pos, count,0 ); -if (unlikely (put_user (pos, offset))) -return -EFAULT ; -return ret; - } - -return do_sendfile (out_fd, in_fd,NULL , count,0 ); -} -#endif
fs/splice.c +178 -0
187 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH 2/56 moved kernel_write out of splice translation unit
In reply to a message not in the archivekernel_write shares infrastructure with the read_write translation unit but not with the splice translation unit. Grouping kernel_write with the read_write translation unit is more logical. It also paves the way to compiling out the splice group of syscalls for embedded systems that do not need them.
--- fs/read_write.c | 16 ++++++++++++++++ fs/splice.c | 16 ---------------- 2 files changed, 16 insertions(+), 16 deletions(-)
fs/read_write.c +16 -0
@@ -1189,3 +1189,19 @@ COMPAT_SYSCALL_DEFINE5(pwritev, compat_ulong_t, fd, }#endif +ssize_t kernel_write (struct file *file,const char *buf,size_t count, +loff_t pos) +{ +mm_segment_t old_fs; +ssize_t res; + + old_fs =get_fs (); +set_fs (get_ds ()); +/* The cast to a user pointer is valid due to the set_fs() */ + res =vfs_write (file, (__force const char __user *)buf, count, &pos); +set_fs (old_fs); + +return res; +} +EXPORT_SYMBOL (kernel_write); +
fs/splice.c +0 -16
@@ -583,22 +583,6 @@ static ssize_t kernel_readv(struct file *file, const struct iovec *vec,return res; } -ssize_t kernel_write (struct file *file,const char *buf,size_t count, -loff_t pos) -{ -mm_segment_t old_fs; -ssize_t res; - - old_fs =get_fs (); -set_fs (get_ds ()); -/* The cast to a user pointer is valid due to the set_fs() */ - res =vfs_write (file, (__force const char __user *)buf, count, &pos); -set_fs (old_fs); - -return res; -} -EXPORT_SYMBOL (kernel_write); -ssize_t default_file_splice_read (struct file *in,loff_t *ppos,struct pipe_inode_info *pipe,size_t len,unsigned int flags)
Signature · 1 line
1.9.1
A message that is not in the archive (sent off-list or not yet received): 1415913813-362-1-git-send-email-pieter-qeJ+1H9vRZbz+pZb47iToQ@public.gmane.org
PATCH 3/56 fs: Support compiling out splice-family syscalls
Many embedded systems will not need the splice-family syscalls (splice, vmsplice, tee and sendfile). Omitting them saves space. This adds a new EXPERT config option CONFIG_SYSCALL_SPLICE (default y) to support compiling them out.
This patch removes almost all callers of .splice_read() and .splice_write() in the file_operations struct. This paves the way to eventually compile out the .splice_read and .splice_write members of the file_operations struct as well as the remaining splice-related infrastructure.
add/remove: 0/16 grow/shrink: 2/5 up/down: 114/-3693 (-3579)
function old new delta splice_direct_to_actor 348 416 +68 splice_to_pipe 371 417 +46 splice_from_pipe_next 107 106 -1 fdput 11 - -11 signal_pending 39 26 -13 fdget 56 42 -14 user_page_pipe_buf_ops 20 - -20 user_page_pipe_buf_steal 25 - -25 file_end_write 58 29 -29 file_start_write 68 34 -34 pipe_to_user 43 - -43 wakeup_pipe_readers 54 - -54 do_splice_to 87 - -87 ipipe_prep.part 92 - -92 opipe_prep.part 119 - -119 sys_sendfile 122 - -122 sys_sendfile64 126 - -126 sys_vmsplice 137 - -137 vmsplice_to_user 205 - -205 sys_tee 491 - -491 do_sendfile 492 - -492 vmsplice_to_pipe 558 - -558 sys_splice 1020 - -1020
--- fs/splice.c | 2 ++ init/Kconfig | 10 ++++++++++ kernel/sys_ni.c | 8 ++++++++ 3 files changed, 20 insertions(+)
fs/splice.c +2 -0
@@ -1316,6 +1316,7 @@ long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,return ret; } +#ifdef CONFIG_SYSCALL_SPLICE static int splice_pipe_to_pipe (struct pipe_inode_info *ipipe,struct pipe_inode_info *opipe,size_t len,unsigned int flags);
@@ -2200,4 +2201,5 @@ COMPAT_SYSCALL_DEFINE4(sendfile64, int, out_fd, int, in_fd,return do_sendfile (out_fd, in_fd,NULL , count,0 ); }#endif +#endif
init/Kconfig +10 -0
@@ -1547,6 +1547,16 @@ config ADVISE_SYSCALLS applications use these syscalls, you can disable this option to save space. +config SYSCALL_SPLICE + bool "Enable splice/vmsplice/tee/sendfile syscalls" if EXPERT + default y + help + This option enables the splice, vmsplice, tee and sendfile syscalls. These + are used by applications to: move data between buffers and arbitrary file + descriptors; "copy" data between buffers; or copy data from userspace into + buffers. If building an embedded system where no applications use these + syscalls, you can disable this option to save space. + config PCI_QUIRKS default y bool "Enable PCI quirk workarounds" if EXPERT
kernel/sys_ni.c +8 -0
@@ -159,6 +159,14 @@ cond_syscall(sys_uselib);cond_syscall (sys_fadvise64);cond_syscall (sys_fadvise64_64);cond_syscall (sys_madvise); +cond_syscall (sys_vmsplice); +cond_syscall (sys_splice); +cond_syscall (sys_tee); +cond_syscall (sys_sendfile); +cond_syscall (sys_sendfile64); +cond_syscall (compat_sys_vmsplice); +cond_syscall (compat_sys_sendfile); +cond_syscall (compat_sys_sendfile64);/* arch-specific weak syscall entries */ cond_syscall (sys_pciconfig_read);
Signature · 1 line
1.9.1
PATCH 4/56 fs: Macros to define splice file_operations
In reply to a message not in the archiveProvides a CONFIG_SYSCALL_SPLICE compatible way of defining the .splice_read and .splice_write file_operations so that they can later be compiled out when the kernel is configured without the splice-family syscalls
--- include/linux/fs.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
include/linux/fs.h +26 -0
@@ -1512,6 +1512,32 @@ struct file_operations {int (*show_fdinfo)(struct seq_file *m,struct file *f); }; +#ifdef CONFIG_SYSCALL_SPLICE + +/* +* Define and init the splice_read member of a file_operations struct +*/ +#define SPLICE_READ_INIT (read) .splice_read = read, + +/* +* Define and init the splice_read member of a file_operations struct +*/ +#define SPLICE_WRITE_INIT (write) .splice_write = write, + +#else /* #ifdef CONFIG_SYSCALL_SPLICE */ + +/* +* Define and init the splice_read member of a file_operations struct +*/ +#define SPLICE_READ_INIT (read) + +/* +* Define and init the splice_read member of a file_operations struct +*/ +#define SPLICE_WRITE_INIT (write) + +#endif /* #ifdef CONFIG_SYSCALL_SPLICE */ +struct inode_operations {struct dentry * (*lookup) (struct inode *,struct dentry *,unsigned int );void * (*follow_link) (struct dentry *,struct nameidata *);
Signature · 1 line
1.9.1
Re: [PATCH 04/56] fs: Macros to define splice file_operations
Quoted 18 lines · Pieter Smith
Provides a
CONFIG_SYSCALL_SPLICEcompatible way of defining the .splice_read and .splice_writefile_operationsso that they can later be compiled out when the kernel is configured without the splice-family syscallsSigned-off-by Pieter Smith <[email protected]>--- include/linux/fs.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)include/linux/fs.h +1
-0@@ -1512,6 +1512,32 @@ struct file_operations {int (*show_fdinfo)(struct seq_file *m,struct file *f); }; +#ifdef CONFIG_SYSCALL_SPLICE
include/linux/fs.h struct file_operations { · line 1525
Quoted 10 lines
include/linux/fs.h +10
-0+ +/* +* Define and init the splice_read member of a file_operations struct +*/ +#define SPLICE_READ_INIT (read) .splice_read = read, + +/* +* Define and init the splice_read member of a file_operations struct +*/ +#define SPLICE_WRITE_INIT (write) .splice_write = write,
This is ugly like hell.
Why can't you do something like __exit_p()?
Signature · 2 lines
Thanks, //richard
Al Viro
maintainerRe: [PATCH 04/56] fs: Macros to define splice file_operations
In reply to Pieter SmithQuoted 3 lines · Pieter Smith
Provides a
CONFIG_SYSCALL_SPLICEcompatible way of defining the .splice_read and .splice_writefile_operationsso that they can later be compiled out when the kernel is configured without the splice-family syscalls
This (and subsequent stuff making use of that) is bloody pointless. You save 2 words per file_operations instance, at the cost of making things uglier and harder to grep. NAK.
Re: [PATCH 04/56] fs: Macros to define splice file_operations
Quoted 4 lines · Richard Weinberger
Quoted 3 lines · Pieter Smith
Provides a
CONFIG_SYSCALL_SPLICEcompatible way of defining the .splice_read and .splice_writefile_operationsso that they can later be compiled out when the kernel is configured without the splice-family syscalls
[...]
Quoted 20 lines
Quoted 7 lines
include/linux/fs.h +1
-0@@ -1512,6 +1512,32 @@ struct file_operations {int (*show_fdinfo)(struct seq_file *m,struct file *f); }; +#ifdef CONFIG_SYSCALL_SPLICE include/linux/fs.h struct file_operations { · line 1525
Quoted 10 lines
include/linux/fs.h +10
-0+ +/* +* Define and init the splice_read member of a file_operations struct +*/ +#define SPLICE_READ_INIT (read) .splice_read = read, + +/* +* Define and init the splice_read member of a file_operations struct +*/ +#define SPLICE_WRITE_INIT (write) .splice_write = write,This is ugly like hell.
Why can't you do something like__exit_p()?
Quoted 3 lines · Al Viro
This (and subsequent stuff making use of that) is bloody pointless. You save 2 words per
file_operationsinstance, at the cost of making things uglier and harder to grep. NAK.
Given the large number of uses of these, I agree that it doesn't seem worth the tradeoff, particularly since very few file_operations structures will exist on any individual tiny configuration. I think we should go with a wrapper similar to __exit_p (splice_p?), which just becomes NULL when !CONFIG_SYSCALL_SPLICE. Removing the actual pointers from file_operations can wait until we have compiler support for tagging specific fields in a structure (like splice_read and splice_write) as dead.
Similarly, you shouldn't wrap the functions that get assigned to those pointers with #ifdef; instead, mark them as __maybe_unused, which doesn't even add any lines of code. The compiler will then automatically throw them out when not used, without emiting a warning.
That should drastically reduce the number of changes, and in particular eliminate almost all of the ifdefs.
- Josh Triplett
PATCH 5/56 fs/lustre: support compiling out splice
In reply to a message not in the archiveCompile out splice support from lustre file-system when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- drivers/staging/lustre/lustre/llite/file.c | 10 +++++++--- drivers/staging/lustre/lustre/llite/llite_internal.h | 2 ++ drivers/staging/lustre/lustre/llite/vvp_io.c | 2 ++ 3 files changed, 11 insertions(+), 3 deletions(-)
drivers/staging/lustre/lustre/llite/file.c +7 -3
@@ -1126,10 +1126,12 @@ restart:down_read (&lli->lli_trunc_sem); }break ; +#ifdef CONFIG_SYSCALL_SPLICE case IO_SPLICE : vio->u.splice.cui_pipe = args->u.splice.via_pipe; vio->u.splice.cui_flags = args->u.splice.via_flags;break ; +#endif /* #ifdef CONFIG_SYSCALL_SPLICE */ default :CERROR ("Unknown IO type - %u\n" , vio->cui_io_subtype);LBUG ();
@@ -1223,6 +1225,7 @@ static ssize_t ll_file_write_iter(struct kiocb *iocb, struct iov_iter *from)return result; } +#ifdef CONFIG_SYSCALL_SPLICE /* * Send file content (through pagecache) somewhere with helper */
@@ -1247,6 +1250,7 @@ static ssize_t ll_file_splice_read(struct file *in_file, loff_t *ppos,cl_env_put (env, &refcheck); return result; } +#endif /* #ifdef CONFIG_SYSCALL_SPLICE */ static int ll_lov_recreate (struct inode *inode,struct ost_id *oi,obd_count ost_idx)
@@ -3078,7 +3082,7 @@ struct file_operations ll_file_operations = { .release = ll_file_release, .mmap = ll_file_mmap, .llseek = ll_file_seek, - .splice_read = ll_file_splice_read, +SPLICE_READ_INIT (ll_file_splice_read) .fsync = ll_fsync, .flush = ll_flush };
@@ -3093,7 +3097,7 @@ struct file_operations ll_file_operations_flock = { .release = ll_file_release, .mmap = ll_file_mmap, .llseek = ll_file_seek, - .splice_read = ll_file_splice_read, +SPLICE_READ_INIT (ll_file_splice_read) .fsync = ll_fsync, .flush = ll_flush, .flock = ll_file_flock,
@@ -3111,7 +3115,7 @@ struct file_operations ll_file_operations_noflock = { .release = ll_file_release, .mmap = ll_file_mmap, .llseek = ll_file_seek, - .splice_read = ll_file_splice_read, +SPLICE_READ_INIT (ll_file_splice_read) .fsync = ll_fsync, .flush = ll_flush, .flock = ll_file_noflock,
drivers/staging/lustre/lustre/llite/llite_internal.h +2 -0
@@ -861,7 +861,9 @@ enum vvp_io_subtype {/** normal IO */ IO_NORMAL,/** io started from splice_{read|write} */ +#ifdef CONFIG_SYSCALL_SPLICE IO_SPLICE +#endif /* #ifdef CONFIG_SYSCALL_SPLICE */ };/* IO subtypes */
drivers/staging/lustre/lustre/llite/vvp_io.c +2 -0
@@ -530,6 +530,7 @@ static int vvp_io_read_start(const struct lu_env *env,LASSERT (cio->cui_iocb->ki_pos == pos); result =generic_file_read_iter (cio->cui_iocb, cio->cui_iter);break ; +#ifdef CONFIG_SYSCALL_SPLICE case IO_SPLICE : result = generic_file_splice_read(file, &pos, vio->u.splice.cui_pipe, cnt,
@@ -539,6 +540,7 @@ static int vvp_io_read_start(const struct lu_env *env,* buffers. */ io->ci_continue =0 ;break ; +#endif /* #ifdef CONFIG_SYSCALL_SPLICE */ default :CERROR ("Wrong IO type %u\n" , vio->cui_io_subtype);LBUG ();
Signature · 1 line
1.9.1
Greg Kroah-Hartman
maintainerRe: [PATCH 05/56] fs/lustre: support compiling out splice
Quoted 16 lines · Pieter Smith
Compile out splice support from lustre file-system when the splice-family of syscalls is not supported by the system (i.e.
CONFIG_SYSCALL_SPLICEis undefined).Signed-off-by Pieter Smith <[email protected]>--- drivers/staging/lustre/lustre/llite/file.c | 10 +++++++--- drivers/staging/lustre/lustre/llite/llite_internal.h | 2 ++ drivers/staging/lustre/lustre/llite/vvp_io.c | 2 ++ 3 files changed, 11 insertions(+), 3 deletions(-)drivers/staging/lustre/lustre/llite/file.c +0
-0
drivers/staging/lustre/lustre/llite/file.c restart: · line 1134
Quoted 9 lines
drivers/staging/lustre/lustre/llite/file.c +2
-0@@ -1126,10 +1126,12 @@ restart:down_read (&lli->lli_trunc_sem); }break ; +#ifdef CONFIG_SYSCALL_SPLICE case IO_SPLICE : vio->u.splice.cui_pipe = args->u.splice.via_pipe; vio->u.splice.cui_flags = args->u.splice.via_flags;break ; +#endif /* #ifdef CONFIG_SYSCALL_SPLICE */
Not worth the #ifdef mess, sorry.
PATCH 6/56 fs/adfs: support compiling out splice
In reply to a message not in the archiveCompile out splice support from adfs when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/adfs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/adfs/file.c +1 -1
@@ -29,7 +29,7 @@ const struct file_operations adfs_file_operations = { .fsync = generic_file_fsync, .write = new_sync_write, .write_iter = generic_file_write_iter, - .splice_read = generic_file_splice_read, + SPLICE_READ_INIT(generic_file_splice_read) };const struct inode_operations adfs_file_inode_operations = {
Signature · 1 line
1.9.1
PATCH 7/56 fs/affs: support compiling out splice
In reply to a message not in the archiveCompile out splice support from affs when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/affs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/affs/file.c +1 -1
@@ -35,7 +35,7 @@ const struct file_operations affs_file_operations = { .open = affs_file_open, .release = affs_file_release, .fsync = affs_file_fsync, - .splice_read = generic_file_splice_read, + SPLICE_READ_INIT(generic_file_splice_read) };const struct inode_operations affs_file_inode_operations = {
Signature · 1 line
1.9.1
PATCH 8/56 fs/afs: support compiling out splice
In reply to a message not in the archiveCompile out splice support from afs when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/afs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/afs/file.c +1 -1
@@ -36,7 +36,7 @@ const struct file_operations afs_file_operations = { .read_iter = generic_file_read_iter, .write_iter = afs_file_write, .mmap = generic_file_readonly_mmap, - .splice_read = generic_file_splice_read, +SPLICE_READ_INIT (generic_file_splice_read) .fsync = afs_fsync, .lock = afs_lock, .flock = afs_flock,
Signature · 1 line
1.9.1
PATCH 9/56 fs/bad_inode: support compiling out splice
In reply to a message not in the archiveCompile out splice support from bad_inode when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
add/remove: 0/2 grow/shrink: 0/0 up/down: 0/-12 (-12)
function old new delta
bad_file_splice_write 6 - -6 bad_file_splice_read 6 - -6
--- fs/bad_inode.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
fs/bad_inode.c +6 -4
@@ -131,14 +131,16 @@ static int bad_file_flock(struct file *filp, int cmd, struct file_lock *fl)return -EIO ; } -static ssize_t bad_file_splice_write (struct pipe_inode_info *pipe, +static ssize_t __maybe_unused bad_file_splice_write ( +struct pipe_inode_info *pipe,struct file *out,loff_t *ppos,size_t len,unsigned int flags) {return -EIO ; } -static ssize_t bad_file_splice_read (struct file *in,loff_t *ppos, +static ssize_t __maybe_unused bad_file_splice_read ( +struct file *in,loff_t *ppos,struct pipe_inode_info *pipe,size_t len,unsigned int flags) {
@@ -168,8 +170,8 @@ static const struct file_operations bad_file_ops = .get_unmapped_area = bad_file_get_unmapped_area, .check_flags = bad_file_check_flags, .flock = bad_file_flock, - .splice_write = bad_file_splice_write, - .splice_read = bad_file_splice_read, + SPLICE_WRITE_INIT(bad_file_splice_write) + SPLICE_READ_INIT(bad_file_splice_read) }; static int bad_inode_create (struct inode *dir, struct dentry *dentry,
Signature · 1 line
1.9.1
PATCH 10/56 fs/block_dev: support compiling out splice
In reply to a message not in the archiveCompile out splice support from block_dev when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/block_dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/block_dev.c +2 -2
@@ -1645,8 +1645,8 @@ const struct file_operations def_blk_fops = {#ifdef CONFIG_COMPAT .compat_ioctl = compat_blkdev_ioctl,#endif - .splice_read = generic_file_splice_read, - .splice_write = iter_file_splice_write, + SPLICE_READ_INIT(generic_file_splice_read) + SPLICE_WRITE_INIT(iter_file_splice_write) }; int ioctl_by_bdev(struct block_device *bdev, unsigned cmd, unsigned long arg)
Signature · 1 line
1.9.1
PATCH 11/56 fs/bfs: support compiling out splice
In reply to a message not in the archiveCompile out splice support from bfs when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/bfs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/bfs/file.c +1 -1
@@ -28,7 +28,7 @@ const struct file_operations bfs_file_operations = { .write = new_sync_write, .write_iter = generic_file_write_iter, .mmap = generic_file_mmap, - .splice_read = generic_file_splice_read, + SPLICE_READ_INIT(generic_file_splice_read) }; static int bfs_move_block(unsigned long from, unsigned long to,
Signature · 1 line
1.9.1
PATCH 12/56 fs/btrfs: support compiling out splice
In reply to a message not in the archiveCompile out splice support from btrfs when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/btrfs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/file.c +1 -1
@@ -2704,7 +2704,7 @@ const struct file_operations btrfs_file_operations = { .read = new_sync_read, .write = new_sync_write, .read_iter = generic_file_read_iter, - .splice_read = generic_file_splice_read, +SPLICE_READ_INIT (generic_file_splice_read) .write_iter = btrfs_file_write_iter, .mmap = btrfs_file_mmap, .open = generic_file_open,
Signature · 1 line
1.9.1
PATCH 13/56 fs/ceph: support compiling out splice
In reply to a message not in the archiveCompile out splice support from ceph when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/ceph/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/ceph/file.c +2 -2
@@ -1251,8 +1251,8 @@ const struct file_operations ceph_file_fops = { .fsync = ceph_fsync, .lock = ceph_lock, .flock = ceph_flock, - .splice_read = generic_file_splice_read, - .splice_write = iter_file_splice_write, + SPLICE_READ_INIT(generic_file_splice_read) +SPLICE_WRITE_INIT (iter_file_splice_write) .unlocked_ioctl = ceph_ioctl, .compat_ioctl = ceph_ioctl, .fallocate = ceph_fallocate,
Signature · 1 line
1.9.1
PATCH 14/56 fs/cifs: support compiling out splice
In reply to a message not in the archiveCompile out splice support from cifs when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/cifs/cifsfs.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
fs/cifs/cifsfs.c +6 -6
@@ -902,7 +902,7 @@ const struct file_operations cifs_file_ops = { .fsync = cifs_fsync, .flush = cifs_flush, .mmap = cifs_file_mmap, - .splice_read = generic_file_splice_read, +SPLICE_READ_INIT (generic_file_splice_read) .llseek = cifs_llseek, #ifdef CONFIG_CIFS_POSIX .unlocked_ioctl = cifs_ioctl,
@@ -921,7 +921,7 @@ const struct file_operations cifs_file_strict_ops = { .fsync = cifs_strict_fsync, .flush = cifs_flush, .mmap = cifs_file_strict_mmap, - .splice_read = generic_file_splice_read, +SPLICE_READ_INIT (generic_file_splice_read) .llseek = cifs_llseek, #ifdef CONFIG_CIFS_POSIX .unlocked_ioctl = cifs_ioctl,
@@ -941,7 +941,7 @@ const struct file_operations cifs_file_direct_ops = { .fsync = cifs_fsync, .flush = cifs_flush, .mmap = cifs_file_mmap, - .splice_read = generic_file_splice_read, + SPLICE_READ_INIT(generic_file_splice_read)#ifdef CONFIG_CIFS_POSIX .unlocked_ioctl = cifs_ioctl,#endif /* CONFIG_CIFS_POSIX */
@@ -959,7 +959,7 @@ const struct file_operations cifs_file_nobrl_ops = { .fsync = cifs_fsync, .flush = cifs_flush, .mmap = cifs_file_mmap, - .splice_read = generic_file_splice_read, +SPLICE_READ_INIT (generic_file_splice_read) .llseek = cifs_llseek, #ifdef CONFIG_CIFS_POSIX .unlocked_ioctl = cifs_ioctl,
@@ -977,7 +977,7 @@ const struct file_operations cifs_file_strict_nobrl_ops = { .fsync = cifs_strict_fsync, .flush = cifs_flush, .mmap = cifs_file_strict_mmap, - .splice_read = generic_file_splice_read, +SPLICE_READ_INIT (generic_file_splice_read) .llseek = cifs_llseek, #ifdef CONFIG_CIFS_POSIX .unlocked_ioctl = cifs_ioctl,
@@ -996,7 +996,7 @@ const struct file_operations cifs_file_direct_nobrl_ops = { .fsync = cifs_fsync, .flush = cifs_flush, .mmap = cifs_file_mmap, - .splice_read = generic_file_splice_read, + SPLICE_READ_INIT(generic_file_splice_read)#ifdef CONFIG_CIFS_POSIX .unlocked_ioctl = cifs_ioctl,#endif /* CONFIG_CIFS_POSIX */
Signature · 1 line
1.9.1
PATCH 15/56 fs/coda: support compiling out splice
In reply to a message not in the archiveCompile out splice support from coda when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/coda/file.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/coda/file.c +3 -1
@@ -42,6 +42,7 @@ coda_file_read(struct file *coda_file, char __user *buf, size_t count, loff_t *preturn host_file->f_op->read (host_file, buf, count, ppos); } +#ifdef CONFIG_SYSCALL_SPLICE static ssize_t coda_file_splice_read(struct file *coda_file, loff_t *ppos, struct pipe_inode_info *pipe, size_t count,
@@ -62,6 +63,7 @@ coda_file_splice_read(struct file *coda_file, loff_t *ppos, return splice_read(host_file, ppos, pipe, count, flags); } +#endif /* #ifdef CONFIG_SYSCALL_SPLICE */ static ssize_t coda_file_write (struct file *coda_file,const char __user *buf,size_t count,loff_t *ppos)
@@ -237,6 +239,6 @@ const struct file_operations coda_file_operations = { .open = coda_open, .release = coda_release, .fsync = coda_fsync, - .splice_read = coda_file_splice_read, + SPLICE_READ_INIT(coda_file_splice_read) };
Signature · 1 line
1.9.1
PATCH 16/56 fs/encryptfs: support compiling out splice
In reply to a message not in the archiveCompile out splice support from encryptfs when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/ecryptfs/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/ecryptfs/file.c +2 -2
@@ -345,7 +345,7 @@ const struct file_operations ecryptfs_dir_fops = { .release = ecryptfs_release, .fsync = ecryptfs_fsync, .fasync = ecryptfs_fasync, - .splice_read = generic_file_splice_read, + SPLICE_READ_INIT(generic_file_splice_read) .llseek = default_llseek, };
@@ -366,5 +366,5 @@ const struct file_operations ecryptfs_main_fops = { .release = ecryptfs_release, .fsync = ecryptfs_fsync, .fasync = ecryptfs_fasync, - .splice_read = generic_file_splice_read, + SPLICE_READ_INIT(generic_file_splice_read) };
Signature · 1 line
1.9.1
PATCH 17/56 fs/exofs: support compiling out splice
In reply to a message not in the archiveCompile out splice support from exofs when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/exofs/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/exofs/file.c +2 -2
@@ -76,8 +76,8 @@ const struct file_operations exofs_file_operations = { .release = exofs_release_file, .fsync = exofs_file_fsync, .flush = exofs_flush, - .splice_read = generic_file_splice_read, - .splice_write = iter_file_splice_write, + SPLICE_READ_INIT(generic_file_splice_read) + SPLICE_WRITE_INIT(iter_file_splice_write) };const struct inode_operations exofs_file_inode_operations = {
Signature · 1 line
1.9.1
Re: [osd-dev] [PATCH 17/56] fs/exofs: support compiling out splice
Quoted 4 lines · Pieter Smith
Compile out splice support from exofs when the splice-family of syscalls is not supported by the system (i.e.
CONFIG_SYSCALL_SPLICEis undefined).Signed-off-by Pieter Smith <[email protected]>
Or do you need that I push it through my tree ?
Quoted 20 lines
--- fs/exofs/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)fs/exofs/file.c +2
-2@@ -76,8 +76,8 @@ const struct file_operations exofs_file_operations = { .release = exofs_release_file, .fsync = exofs_file_fsync, .flush = exofs_flush, - .splice_read = generic_file_splice_read, - .splice_write = iter_file_splice_write, + SPLICE_READ_INIT(generic_file_splice_read) + SPLICE_WRITE_INIT(iter_file_splice_write) };const struct inode_operations exofs_file_inode_operations = {
PATCH 18/56 fs/ext2: support compiling out splice
In reply to a message not in the archiveCompile out splice support from ext2 when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/ext2/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/ext2/file.c +2 -2
@@ -74,8 +74,8 @@ const struct file_operations ext2_file_operations = { .open = dquot_file_open, .release = ext2_release_file, .fsync = ext2_fsync, - .splice_read = generic_file_splice_read, - .splice_write = iter_file_splice_write, + SPLICE_READ_INIT(generic_file_splice_read) + SPLICE_WRITE_INIT(iter_file_splice_write) };#ifdef CONFIG_EXT2_FS_XIP
Signature · 1 line
1.9.1
PATCH 19/56 fs/ext3: support compiling out splice
In reply to a message not in the archiveCompile out splice support from ext3 when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/ext3/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/ext3/file.c +2 -2
@@ -62,8 +62,8 @@ const struct file_operations ext3_file_operations = { .open = dquot_file_open, .release = ext3_release_file, .fsync = ext3_sync_file, - .splice_read = generic_file_splice_read, - .splice_write = iter_file_splice_write, + SPLICE_READ_INIT(generic_file_splice_read) + SPLICE_WRITE_INIT(iter_file_splice_write) };const struct inode_operations ext3_file_inode_operations = {
Signature · 1 line
1.9.1
PATCH 20/56 fs/ext4: support compiling out splice
In reply to a message not in the archiveCompile out splice support from ext4 when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/ext4/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/ext4/file.c +2 -2
@@ -595,8 +595,8 @@ const struct file_operations ext4_file_operations = { .open = ext4_file_open, .release = ext4_release_file, .fsync = ext4_sync_file, - .splice_read = generic_file_splice_read, - .splice_write = iter_file_splice_write, + SPLICE_READ_INIT(generic_file_splice_read) + SPLICE_WRITE_INIT(iter_file_splice_write) .fallocate = ext4_fallocate, };
Signature · 1 line
1.9.1
Re: [PATCH 20/56] fs/ext4: support compiling out splice
Quoted 4 lines · Pieter Smith
Compile out splice support from ext4 when the splice-family of syscalls is not supported by the system (i.e.
CONFIG_SYSCALL_SPLICEis undefined).Signed-off-by Pieter Smith <[email protected]>
See below; you shouldn't need this or similar patches for most filesystems at all.
Quoted 8 lines
fs/ext4/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)fs/ext4/file.c +0
-0
fs/ext4/file.c const struct file_operations ext4_file_operations = { · line 599
Quoted 7 lines
fs/ext4/file.c +2
-2@@ -595,8 +595,8 @@ const struct file_operations ext4_file_operations = { .open = ext4_file_open, .release = ext4_release_file, .fsync = ext4_sync_file, - .splice_read = generic_file_splice_read, - .splice_write = iter_file_splice_write, +SPLICE_READ_INIT (generic_file_splice_read) +SPLICE_WRITE_INIT (iter_file_splice_write)
You can just define iter_file_splice_write as NULL when configuring out splice. You could almost do the same for generic_file_splice_read, but a couple of implementations of filesystem-specific splice functions actually call it; you can make it a no-op static inline, though.
- Josh Triplett
PATCH 21/56 fs/f2fs: support compiling out splice
In reply to a message not in the archiveCompile out splice support from f2fs when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/f2fs/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/f2fs/file.c +2 -2
@@ -853,6 +853,6 @@ const struct file_operations f2fs_file_operations = {#ifdef CONFIG_COMPAT .compat_ioctl = f2fs_compat_ioctl,#endif - .splice_read = generic_file_splice_read, - .splice_write = iter_file_splice_write, + SPLICE_READ_INIT(generic_file_splice_read) + SPLICE_WRITE_INIT(iter_file_splice_write) };
Signature · 9 lines
1.9.1 ------------------------------------------------------------------------------ Comprehensive Server Monitoring with Site24x7. Monitor 10 servers for $9/Month. Get alerted through email, SMS, voice calls or mobile push notifications. Take corrective actions from your mobile device. http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
PATCH 22/56 fs/fat: support compiling out splice
In reply to a message not in the archiveCompile out splice support from fat when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/fat/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/fat/file.c +1 -1
@@ -181,7 +181,7 @@ const struct file_operations fat_file_operations = { .compat_ioctl = fat_generic_compat_ioctl, #endif .fsync = fat_file_fsync, - .splice_read = generic_file_splice_read, +SPLICE_READ_INIT (generic_file_splice_read) };static int fat_cont_expand (struct inode *inode,loff_t size)
Signature · 1 line
1.9.1
PATCH 23/56 fs/fuse: support compiling out splice
In reply to a message not in the archiveCompile out splice support from fuse when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/fuse/dev.c | 8 ++++++-- fs/fuse/file.c | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-)
fs/fuse/dev.c +6 -2
@@ -1291,6 +1291,7 @@ static ssize_t fuse_dev_read(struct kiocb *iocb, const struct iovec *iov,return fuse_dev_do_read (fc, file, &cs,iov_length (iov, nr_segs)); } +#ifdef CONFIG_SYSCALL_SPLICE static ssize_t fuse_dev_splice_read (struct file *in,loff_t *ppos,struct pipe_inode_info *pipe,size_t len,unsigned int flags)
@@ -1368,6 +1369,7 @@ out:kfree (bufs); return ret; } +#endif /* #ifdef CONFIG_SYSCALL_SPLICE */ static int fuse_notify_poll (struct fuse_conn *fc,unsigned int size,struct fuse_copy_state *cs)
@@ -1894,6 +1896,7 @@ static ssize_t fuse_dev_write(struct kiocb *iocb, const struct iovec *iov,return fuse_dev_do_write (fc, &cs,iov_length (iov, nr_segs)); } +#ifdef CONFIG_SYSCALL_SPLICE static ssize_t fuse_dev_splice_write (struct pipe_inode_info *pipe,struct file *out,loff_t *ppos,size_t len,unsigned int flags)
@@ -1971,6 +1974,7 @@ out:kfree (bufs); return ret; } +#endif /* #ifdef CONFIG_SYSCALL_SPLICE */ static unsigned fuse_dev_poll (struct file *file,poll_table *wait) {
@@ -2144,10 +2148,10 @@ const struct file_operations fuse_dev_operations = { .llseek = no_llseek, .read = do_sync_read, .aio_read = fuse_dev_read, - .splice_read = fuse_dev_splice_read, +SPLICE_READ_INIT (fuse_dev_splice_read) .write = do_sync_write, .aio_write = fuse_dev_write, - .splice_write = fuse_dev_splice_write, +SPLICE_WRITE_INIT (fuse_dev_splice_write) .poll = fuse_dev_poll, .release = fuse_dev_release, .fasync = fuse_dev_fasync,
fs/fuse/file.c +1 -1
@@ -3042,7 +3042,7 @@ static const struct file_operations fuse_file_operations = { .fsync = fuse_fsync, .lock = fuse_file_lock, .flock = fuse_file_flock, - .splice_read = generic_file_splice_read, +SPLICE_READ_INIT (generic_file_splice_read) .unlocked_ioctl = fuse_file_ioctl, .compat_ioctl = fuse_file_compat_ioctl, .poll = fuse_file_poll,
Signature · 1 line
1.9.1
PATCH 24/56 fs/gfs2: support compiling out splice
In reply to a message not in the archiveCompile out splice support from gfs2 when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/gfs2/file.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
fs/gfs2/file.c +4 -4
@@ -1067,8 +1067,8 @@ const struct file_operations gfs2_file_fops = { .fsync = gfs2_fsync, .lock = gfs2_lock, .flock = gfs2_flock, - .splice_read = generic_file_splice_read, - .splice_write = iter_file_splice_write, + SPLICE_READ_INIT(generic_file_splice_read) +SPLICE_WRITE_INIT (iter_file_splice_write) .setlease = gfs2_setlease, .fallocate = gfs2_fallocate, };
@@ -1097,8 +1097,8 @@ const struct file_operations gfs2_file_fops_nolock = { .open = gfs2_open, .release = gfs2_release, .fsync = gfs2_fsync, - .splice_read = generic_file_splice_read, - .splice_write = iter_file_splice_write, + SPLICE_READ_INIT(generic_file_splice_read) +SPLICE_WRITE_INIT (iter_file_splice_write) .setlease = generic_setlease, .fallocate = gfs2_fallocate, };
Signature · 1 line
1.9.1
PATCH 25/56 fs/hfs: support compiling out splice
In reply to a message not in the archiveCompile out splice support from hfs when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/hfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/hfs/inode.c +1 -1
@@ -679,7 +679,7 @@ static const struct file_operations hfs_file_operations = { .write = new_sync_write, .write_iter = generic_file_write_iter, .mmap = generic_file_mmap, - .splice_read = generic_file_splice_read, +SPLICE_READ_INIT (generic_file_splice_read) .fsync = hfs_file_fsync, .open = hfs_file_open, .release = hfs_file_release,
Signature · 1 line
1.9.1
PATCH 26/56 fs/hfsplus: support compiling out splice
In reply to a message not in the archiveCompile out splice support from hfsplus when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/hfsplus/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/hfsplus/inode.c +1 -1
@@ -346,7 +346,7 @@ static const struct file_operations hfsplus_file_operations = { .write = new_sync_write, .write_iter = generic_file_write_iter, .mmap = generic_file_mmap, - .splice_read = generic_file_splice_read, +SPLICE_READ_INIT (generic_file_splice_read) .fsync = hfsplus_file_fsync, .open = hfsplus_file_open, .release = hfsplus_file_release,
Signature · 1 line
1.9.1
PATCH 27/56 fs/hostfs: support compiling out splice
In reply to a message not in the archiveCompile out splice support from hostfs when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/hostfs/hostfs_kern.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/hostfs/hostfs_kern.c +1 -1
@@ -379,7 +379,7 @@ static int hostfs_fsync(struct file *file, loff_t start, loff_t end,static const struct file_operations hostfs_file_fops = { .llseek = generic_file_llseek, .read = new_sync_read, - .splice_read = generic_file_splice_read, +SPLICE_READ_INIT (generic_file_splice_read) .read_iter = generic_file_read_iter, .write_iter = generic_file_write_iter, .write = new_sync_write,
Signature · 1 line
1.9.1
PATCH 28/56 fs/hpfs: support compiling out splice
In reply to a message not in the archiveCompile out splice support from hpfs when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/hpfs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/hpfs/file.c +1 -1
@@ -204,7 +204,7 @@ const struct file_operations hpfs_file_ops = .mmap = generic_file_mmap, .release = hpfs_file_release, .fsync = hpfs_file_fsync, - .splice_read = generic_file_splice_read, + SPLICE_READ_INIT(generic_file_splice_read) }; const struct inode_operations hpfs_file_iops =
Signature · 1 line
1.9.1
PATCH 29/56 fs/jffs2: support compiling out splice
In reply to a message not in the archiveCompile out splice support from jffs2 when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/jffs2/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/jffs2/file.c +1 -1
@@ -58,7 +58,7 @@ const struct file_operations jffs2_file_operations = .unlocked_ioctl=jffs2_ioctl, .mmap = generic_file_readonly_mmap, .fsync = jffs2_fsync, - .splice_read = generic_file_splice_read, + SPLICE_READ_INIT(generic_file_splice_read) };/* jffs2_file_inode_operations */
Signature · 1 line
1.9.1
PATCH 30/56 fs/jfs: support compiling out splice
In reply to a message not in the archiveCompile out splice support from jfs when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/jfs/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/jfs/file.c +2 -2
@@ -156,8 +156,8 @@ const struct file_operations jfs_file_operations = { .read_iter = generic_file_read_iter, .write_iter = generic_file_write_iter, .mmap = generic_file_mmap, - .splice_read = generic_file_splice_read, - .splice_write = iter_file_splice_write, + SPLICE_READ_INIT(generic_file_splice_read) +SPLICE_WRITE_INIT (iter_file_splice_write) .fsync = jfs_fsync, .release = jfs_release, .unlocked_ioctl = jfs_ioctl,
Signature · 1 line
1.9.1
PATCH 31/56 fs/minix: support compiling out splice
In reply to a message not in the archiveCompile out splice support from minix when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/minix/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/minix/file.c +1 -1
@@ -20,7 +20,7 @@ const struct file_operations minix_file_operations = { .write_iter = generic_file_write_iter, .mmap = generic_file_mmap, .fsync = generic_file_fsync, - .splice_read = generic_file_splice_read, + SPLICE_READ_INIT(generic_file_splice_read) };static int minix_setattr (struct dentry *dentry,struct iattr *attr)
Signature · 1 line
1.9.1
PATCH 32/56 fs/nfs: support compiling out splice
In reply to a message not in the archiveCompile out splice support from nfs when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/nfs/file.c | 6 ++++-- fs/nfs/nfs4file.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-)
fs/nfs/file.c +4 -2
@@ -187,6 +187,7 @@ nfs_file_read(struct kiocb *iocb, struct iov_iter *to) }EXPORT_SYMBOL_GPL (nfs_file_read); +#ifdef CONFIG_SYSCALL_SPLICE ssize_t nfs_file_splice_read(struct file *filp, loff_t *ppos, struct pipe_inode_info *pipe, size_t count,
@@ -207,6 +208,7 @@ nfs_file_splice_read(struct file *filp, loff_t *ppos, return res; }EXPORT_SYMBOL_GPL (nfs_file_splice_read); +#endif /* #ifdef CONFIG_SYSCALL_SPLICE */ int nfs_file_mmap (struct file * file,struct vm_area_struct * vma)
@@ -915,8 +917,8 @@ const struct file_operations nfs_file_operations = { .fsync = nfs_file_fsync, .lock = nfs_lock, .flock = nfs_flock, - .splice_read = nfs_file_splice_read, - .splice_write = iter_file_splice_write, + SPLICE_READ_INIT(nfs_file_splice_read) +SPLICE_WRITE_INIT (iter_file_splice_write) .check_flags = nfs_check_flags, .setlease = nfs_setlease, };
fs/nfs/nfs4file.c +2 -2
@@ -128,8 +128,8 @@ const struct file_operations nfs4_file_operations = { .fsync = nfs4_file_fsync, .lock = nfs_lock, .flock = nfs_flock, - .splice_read = nfs_file_splice_read, - .splice_write = iter_file_splice_write, + SPLICE_READ_INIT(nfs_file_splice_read) +SPLICE_WRITE_INIT (iter_file_splice_write) .check_flags = nfs_check_flags, .setlease = nfs_setlease, };
Signature · 1 line
1.9.1
PATCH 33/56 fs/nfsd: support compiling out splice
In reply to a message not in the archiveCompile out splice support from nfsd when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/nfsd/nfs4xdr.c | 4 ++++ fs/nfsd/vfs.c | 6 ++++++ 2 files changed, 10 insertions(+)
fs/nfsd/nfs4xdr.c +4 -0
@@ -3060,6 +3060,7 @@ nfsd4_encode_open_downgrade(struct nfsd4_compoundres *resp, __be32 nfserr, strucreturn nfserr; } +#ifdef CONFIG_SYSCALL_SPLICE static __be32 nfsd4_encode_splice_read( struct nfsd4_compoundres *resp, struct nfsd4_read *read,
@@ -3119,6 +3120,7 @@ static __be32 nfsd4_encode_splice_read(return 0 ; } +#endif /* #ifdef CONFIG_SYSCALL_SPLICE */ static __be32 nfsd4_encode_readv(struct nfsd4_compoundres *resp, struct nfsd4_read *read,
@@ -3216,9 +3218,11 @@ nfsd4_encode_read(struct nfsd4_compoundres *resp, __be32 nfserr, goto err_truncate; } +#ifdef CONFIG_SYSCALL_SPLICE if (file->f_op->splice_read && resp->rqstp->rq_splice_ok) err =nfsd4_encode_splice_read (resp, read, file, maxcount); else +#endif /* #ifdef CONFIG_SYSCALL_SPLICE */ err =nfsd4_encode_readv (resp, read, file, maxcount);if (!read->rd_filp)
fs/nfsd/vfs.c +6 -0
@@ -779,6 +779,7 @@ found:return ra; } +#ifdef CONFIG_SYSCALL_SPLICE /* * Grab and keep cached pages associated with a file in the svc_rqst * so that they can be passed to the network sendmsg/sendpage routines
@@ -818,6 +819,7 @@ static int nfsd_direct_splice_actor(struct pipe_inode_info *pipe, {return __splice_from_pipe (pipe, sd, nfsd_splice_actor); } +#endif /* #ifdef CONFIG_SYSCALL_SPLICE */ static __be32 nfsd_finish_read (struct file *file,unsigned long *count,int host_err)
@@ -831,6 +833,7 @@ nfsd_finish_read(struct file *file, unsigned long *count, int host_err)return nfserrno (host_err); } +#ifdef CONFIG_SYSCALL_SPLICE __be32 nfsd_splice_read (struct svc_rqst *rqstp,struct file *file,loff_t offset,unsigned long *count) {
@@ -846,6 +849,7 @@ __be32 nfsd_splice_read(struct svc_rqst *rqstp, host_err =splice_direct_to_actor (file, &sd, nfsd_direct_splice_actor); return nfsd_finish_read(file, count, host_err); } +#endif /* #ifdef CONFIG_SYSCALL_SPLICE */ __be32 nfsd_readv (struct file *file,loff_t offset,struct kvec *vec,int vlen,unsigned long *count)
@@ -864,9 +868,11 @@ static __be32 nfsd_vfs_read(struct svc_rqst *rqstp, struct file *file, loff_t offset, struct kvec *vec, int vlen, unsigned long *count) { +#ifdef CONFIG_SYSCALL_SPLICE if (file->f_op->splice_read && rqstp->rq_splice_ok) return nfsd_splice_read(rqstp, file, offset, count); else +#endif return nfsd_readv(file, offset, vec, vlen, count); }
Signature · 1 line
1.9.1
PATCH 34/56 fs/nilfs2: support compiling out splice
In reply to a message not in the archiveCompile out splice support from nilfs2 when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/nilfs2/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nilfs2/file.c +1 -1
@@ -164,7 +164,7 @@ const struct file_operations nilfs_file_operations = { .open = generic_file_open, /* .release = nilfs_release_file, */ .fsync = nilfs_sync_file, - .splice_read = generic_file_splice_read, + SPLICE_READ_INIT(generic_file_splice_read) };const struct inode_operations nilfs_file_inode_operations = {
Signature · 1 line
1.9.1
PATCH 35/56 fs/ntfs: support compiling out splice
In reply to a message not in the archiveCompile out splice support from ntfs when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/ntfs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ntfs/file.c +1 -1
@@ -2216,7 +2216,7 @@ const struct file_operations ntfs_file_ops = {mounted filesystem. */ .mmap = generic_file_mmap, /* Mmap file. */ .open = ntfs_file_open,/* Open file. */ - .splice_read = generic_file_splice_read /* Zero-copy data send with +SPLICE_READ_INIT (generic_file_splice_read)/* Zero-copy data send with the data source being on the ntfs partition. We do not need to care about the
Signature · 1 line
1.9.1
PATCH 36/56 fs/ocfs2: support compiling out splice
In reply to a message not in the archiveCompile out splice support from ocfs2 when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/ocfs2/file.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
fs/ocfs2/file.c +6 -4
@@ -2430,6 +2430,7 @@ out_sems:return ret; } +#ifdef CONFIG_SYSCALL_SPLICE static ssize_t ocfs2_file_splice_read(struct file *in, loff_t *ppos, struct pipe_inode_info *pipe,
@@ -2459,6 +2460,7 @@ static ssize_t ocfs2_file_splice_read(struct file *in, bail: return ret; } +#endif /* #ifdef CONFIG_SYSCALL_SPLICE */ static ssize_t ocfs2_file_read_iter (struct kiocb *iocb,struct iov_iter *to)
@@ -2629,8 +2631,8 @@ const struct file_operations ocfs2_fops = {#endif .lock = ocfs2_lock, .flock = ocfs2_flock, - .splice_read = ocfs2_file_splice_read, - .splice_write = iter_file_splice_write, + SPLICE_READ_INIT(ocfs2_file_splice_read) + SPLICE_WRITE_INIT(iter_file_splice_write) .fallocate = ocfs2_fallocate, };
@@ -2676,8 +2678,8 @@ const struct file_operations ocfs2_fops_no_plocks = { .compat_ioctl = ocfs2_compat_ioctl, #endif .flock = ocfs2_flock, - .splice_read = ocfs2_file_splice_read, - .splice_write = iter_file_splice_write, + SPLICE_READ_INIT(ocfs2_file_splice_read) +SPLICE_WRITE_INIT (iter_file_splice_write) .fallocate = ocfs2_fallocate, };
Signature · 1 line
1.9.1
PATCH 37/56 fs/omfs: support compiling out splice
In reply to a message not in the archiveCompile out splice support from omfs when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/omfs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/omfs/file.c +1 -1
@@ -343,7 +343,7 @@ const struct file_operations omfs_file_operations = { .write_iter = generic_file_write_iter, .mmap = generic_file_mmap, .fsync = generic_file_fsync, - .splice_read = generic_file_splice_read, + SPLICE_READ_INIT(generic_file_splice_read) };static int omfs_setattr (struct dentry *dentry,struct iattr *attr)
Signature · 1 line
1.9.1
PATCH 38/56 fs/ramfs: support compiling out splice
In reply to a message not in the archiveCompile out splice support from ramfs when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/ramfs/file-mmu.c | 4 ++-- fs/ramfs/file-nommu.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
fs/ramfs/file-mmu.c +2 -2
@@ -37,8 +37,8 @@ const struct file_operations ramfs_file_operations = { .write_iter = generic_file_write_iter, .mmap = generic_file_mmap, .fsync = noop_fsync, - .splice_read = generic_file_splice_read, - .splice_write = iter_file_splice_write, + SPLICE_READ_INIT(generic_file_splice_read) + SPLICE_WRITE_INIT(iter_file_splice_write) .llseek = generic_file_llseek, };
fs/ramfs/file-nommu.c +2 -2
@@ -42,8 +42,8 @@ const struct file_operations ramfs_file_operations = { .write = new_sync_write, .write_iter = generic_file_write_iter, .fsync = noop_fsync, - .splice_read = generic_file_splice_read, - .splice_write = iter_file_splice_write, + SPLICE_READ_INIT(generic_file_splice_read) + SPLICE_WRITE_INIT(iter_file_splice_write) .llseek = generic_file_llseek, };
Signature · 1 line
1.9.1
PATCH 39/56 fs/reiserfs: support compiling out splice
In reply to a message not in the archiveCompile out splice support from reiserfs when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/reiserfs/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/reiserfs/file.c +2 -2
@@ -255,8 +255,8 @@ const struct file_operations reiserfs_file_operations = { .fsync = reiserfs_sync_file, .read_iter = generic_file_read_iter, .write_iter = generic_file_write_iter, - .splice_read = generic_file_splice_read, - .splice_write = iter_file_splice_write, + SPLICE_READ_INIT(generic_file_splice_read) + SPLICE_WRITE_INIT(iter_file_splice_write) .llseek = generic_file_llseek, };
Signature · 1 line
1.9.1
PATCH 40/56 fs/romfs: support compiling out splice
In reply to a message not in the archiveCompile out splice support from romfs when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/romfs/mmap-nommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/romfs/mmap-nommu.c +1 -1
@@ -74,7 +74,7 @@ const struct file_operations romfs_ro_fops = { .llseek = generic_file_llseek, .read = new_sync_read, .read_iter = generic_file_read_iter, - .splice_read = generic_file_splice_read, +SPLICE_READ_INIT (generic_file_splice_read) .mmap = romfs_mmap, .get_unmapped_area = romfs_get_unmapped_area, };
Signature · 1 line
1.9.1
PATCH 41/56 fs/sysv: support compiling out splice
In reply to a message not in the archiveCompile out splice support from sysv when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/sysv/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/sysv/file.c +1 -1
@@ -27,7 +27,7 @@ const struct file_operations sysv_file_operations = { .write_iter = generic_file_write_iter, .mmap = generic_file_mmap, .fsync = generic_file_fsync, - .splice_read = generic_file_splice_read, + SPLICE_READ_INIT(generic_file_splice_read) };static int sysv_setattr (struct dentry *dentry,struct iattr *attr)
Signature · 1 line
1.9.1
PATCH 42/56 fs/ubifs: support compiling out splice
In reply to a message not in the archiveCompile out splice support from ubifs when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/ubifs/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/ubifs/file.c +2 -2
@@ -1584,8 +1584,8 @@ const struct file_operations ubifs_file_operations = { .mmap = ubifs_file_mmap, .fsync = ubifs_fsync, .unlocked_ioctl = ubifs_ioctl, - .splice_read = generic_file_splice_read, - .splice_write = iter_file_splice_write, + SPLICE_READ_INIT(generic_file_splice_read) + SPLICE_WRITE_INIT(iter_file_splice_write)#ifdef CONFIG_COMPAT .compat_ioctl = ubifs_compat_ioctl,#endif
Signature · 1 line
1.9.1
PATCH 43/56 fs/udf: support compiling out splice
In reply to a message not in the archiveCompile out splice support from udf when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/udf/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/udf/file.c +1 -1
@@ -242,7 +242,7 @@ const struct file_operations udf_file_operations = { .write_iter = udf_file_write_iter, .release = udf_release_file, .fsync = generic_file_fsync, - .splice_read = generic_file_splice_read, + SPLICE_READ_INIT(generic_file_splice_read) .llseek = generic_file_llseek, };
Signature · 1 line
1.9.1
PATCH 44/56 fs/ufs: support compiling out splice
In reply to a message not in the archiveCompile out splice support from ufs when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/ufs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ufs/file.c +1 -1
@@ -42,5 +42,5 @@ const struct file_operations ufs_file_operations = { .mmap = generic_file_mmap, .open = generic_file_open, .fsync = generic_file_fsync, - .splice_read = generic_file_splice_read, + SPLICE_READ_INIT(generic_file_splice_read) };
Signature · 1 line
1.9.1
PATCH 45/56 fs/xfs: support compiling out splice
In reply to a message not in the archiveCompile out splice support from xfs when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/xfs/xfs_file.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
fs/xfs/xfs_file.c +4 -2
@@ -311,6 +311,7 @@ xfs_file_read_iter(return ret; } +#ifdef CONFIG_SYSCALL_SPLICE STATIC ssize_t xfs_file_splice_read( struct file *infilp,
@@ -342,6 +343,7 @@ xfs_file_splice_read(xfs_rw_iunlock (ip,XFS_IOLOCK_SHARED ); return ret; } +#endif /* #ifdef CONFIG_SYSCALL_SPLICE */ /* * This routine is called to handle zeroing any space in the last block of the
@@ -1415,8 +1417,8 @@ const struct file_operations xfs_file_operations = { .write = new_sync_write, .read_iter = xfs_file_read_iter, .write_iter = xfs_file_write_iter, - .splice_read = xfs_file_splice_read, - .splice_write = iter_file_splice_write, + SPLICE_READ_INIT(xfs_file_splice_read) +SPLICE_WRITE_INIT (iter_file_splice_write) .unlocked_ioctl = xfs_file_ioctl, #ifdef CONFIG_COMPAT .compat_ioctl = xfs_file_compat_ioctl,
Signature · 1 line
1.9.1
PATCH 46/56 kernel/relay: support compiling out splice
In reply to a message not in the archiveCompile out splice support from relay when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- kernel/relay.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
kernel/relay.c +3 -1
@@ -1201,6 +1201,7 @@ static const struct pipe_buf_operations relay_pipe_buf_ops = { .get = generic_pipe_buf_get, }; +#ifdef CONFIG_SYSCALL_SPLICE static void relay_page_release (struct splice_pipe_desc *spd,unsigned int i) { }
@@ -1338,6 +1339,7 @@ static ssize_t relay_file_splice_read(struct file *in,return ret; } +#endif /* #ifdef CONFIG_SYSCALL_SPLICE */ const struct file_operations relay_file_operations = { .open = relay_file_open,
@@ -1346,7 +1348,7 @@ const struct file_operations relay_file_operations = { .read = relay_file_read, .llseek = no_llseek, .release = relay_file_release, - .splice_read = relay_file_splice_read, + SPLICE_READ_INIT(relay_file_splice_read) };EXPORT_SYMBOL_GPL (relay_file_operations);
Signature · 1 line
1.9.1
PATCH 47/56 kenel/trace: support compiling out splice
In reply to a message not in the archiveCompile out splice support from trace when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- kernel/trace/trace.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
kernel/trace/trace.c +12 -3
@@ -938,6 +938,7 @@ out:return ret; } +#ifdef CONFIG_SYSCALL_SPLICE static ssize_t trace_seq_to_buffer (struct trace_seq *s,void *buf,size_t cnt) {int len;
@@ -953,6 +954,7 @@ static ssize_t trace_seq_to_buffer(struct trace_seq *s, void *buf, size_t cnt) s->readpos += cnt; return cnt; } +#endif /* #ifdef CONFIG_SYSCALL_SPLICE */ unsigned long __read_mostly tracing_thresh;
@@ -4552,6 +4554,7 @@ out:return sret; } +#ifdef CONFIG_SYSCALL_SPLICE static void tracing_spd_release_pipe (struct splice_pipe_desc *spd,unsigned int idx) {
@@ -4690,6 +4693,7 @@ out_err:mutex_unlock (&iter->mutex); goto out; } +#endif /* #ifdef CONFIG_SYSCALL_SPLICE */ static ssize_t tracing_entries_read(struct file *filp, char __user *ubuf,
@@ -5164,8 +5168,11 @@ static int tracing_buffers_open(struct inode *inode, struct file *filp);static ssize_t tracing_buffers_read (struct file *filp,char __user *ubuf,size_t count,loff_t *ppos);static int tracing_buffers_release (struct inode *inode,struct file *file); + +#ifdef CONFIG_SYSCALL_SPLICE static ssize_t tracing_buffers_splice_read (struct file *file,loff_t *ppos,struct pipe_inode_info *pipe,size_t len,unsigned int flags); +#endif /* #ifdef CONFIG_SYSCALL_SPLICE */ static int snapshot_raw_open (struct inode *inode,struct file *filp) {
@@ -5217,7 +5224,7 @@ static const struct file_operations tracing_pipe_fops = { .open = tracing_open_pipe, .poll = tracing_poll_pipe, .read = tracing_read_pipe, - .splice_read = tracing_splice_read_pipe, +SPLICE_READ_INIT (tracing_splice_read_pipe) .release = tracing_release_pipe, .llseek = no_llseek, };
@@ -5271,7 +5278,7 @@ static const struct file_operations snapshot_raw_fops = { .open = snapshot_raw_open, .read = tracing_buffers_read, .release = tracing_buffers_release, - .splice_read = tracing_buffers_splice_read, + SPLICE_READ_INIT(tracing_buffers_splice_read) .llseek = no_llseek, };
@@ -5464,6 +5471,7 @@ static const struct pipe_buf_operations buffer_pipe_buf_ops = { .get = buffer_pipe_buf_get, }; +#ifdef CONFIG_SYSCALL_SPLICE /* * Callback from splice_to_pipe(), if we need to release some pages * at the end of the spd in case we error'ed out in filling the pipe.
@@ -5605,13 +5613,14 @@ out: return ret; } +#endif /* #ifdef CONFIG_SYSCALL_SPLICE */ static const struct file_operations tracing_buffers_fops = { .open = tracing_buffers_open, .read = tracing_buffers_read, .poll = tracing_buffers_poll, .release = tracing_buffers_release, - .splice_read = tracing_buffers_splice_read, +SPLICE_READ_INIT (tracing_buffers_splice_read) .llseek = no_llseek, };
Signature · 1 line
1.9.1
Steven Rostedt
maintainerRe: [PATCH 47/56] kenel/trace: support compiling out splice
Quoted 2 lines · On Thu, 13 Nov 2014 22:23:24 +0100 Pieter Smith <[email protected]> wrote:
Compile out splice support from trace when the splice-family of syscalls is not supported by the system (i.e.
CONFIG_SYSCALL_SPLICEis undefined).
The tracing code is a hell of a lot bigger than the splice code. If you are doing this to save space, then simply make the tracing code select SYSCALL_SPLICE, and leave the rest of the #ifdef out.
Thanks,
-- Steve
PATCH 48/56 mm/shmem: support compiling out splice
In reply to a message not in the archiveCompile out splice support from shmem when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- mm/shmem.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
mm/shmem.c +4 -2
@@ -1626,6 +1626,7 @@ static ssize_t shmem_file_read_iter(struct kiocb *iocb, struct iov_iter *to)return retval ? retval : error; } +#ifdef CONFIG_SYSCALL_SPLICE static ssize_t shmem_file_splice_read (struct file *in,loff_t *ppos,struct pipe_inode_info *pipe,size_t len,unsigned int flags)
@@ -1739,6 +1740,7 @@ static ssize_t shmem_file_splice_read(struct file *in, loff_t *ppos, }return error; } +#endif /* #ifdef CONFIG_SYSCALL_SPLICE */ /* * llseek SEEK_DATA or SEEK_HOLE through the radix_tree.
@@ -3088,8 +3090,8 @@ static const struct file_operations shmem_file_operations = { .read_iter = shmem_file_read_iter, .write_iter = generic_file_write_iter, .fsync = noop_fsync, - .splice_read = shmem_file_splice_read, - .splice_write = iter_file_splice_write, + SPLICE_READ_INIT(shmem_file_splice_read) + SPLICE_WRITE_INIT(iter_file_splice_write) .fallocate = shmem_fallocate,#endif };
Signature · 7 lines
1.9.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
PATCH 49/56 net/socket: support compiling out splice
In reply to a message not in the archiveCompile out splice support from socket when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- net/socket.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
net/socket.c +4 -3
@@ -155,8 +155,8 @@ static const struct file_operations socket_file_ops = { .release = sock_close, .fasync = sock_fasync, .sendpage = sock_sendpage, - .splice_write = generic_splice_sendpage, - .splice_read = sock_splice_read, + SPLICE_WRITE_INIT(generic_splice_sendpage) + SPLICE_READ_INIT(sock_splice_read) };/*
@@ -881,7 +881,8 @@ static ssize_t sock_sendpage(struct file *file, struct page *page,return kernel_sendpage (sock, page, offset, size, flags); } -static ssize_t sock_splice_read (struct file *file,loff_t *ppos, +static ssize_t __maybe_unused sock_splice_read ( +struct file *file,loff_t *ppos,struct pipe_inode_info *pipe,size_t len,unsigned int flags) {
Signature · 1 line
1.9.1
PATCH 50/56 fs/read_write: support compiling out splice
In reply to a message not in the archiveCompile out splice support from read_write when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- fs/read_write.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/read_write.c +1 -1
@@ -32,7 +32,7 @@ const struct file_operations generic_ro_fops = { .read = new_sync_read, .read_iter = generic_file_read_iter, .mmap = generic_file_readonly_mmap, - .splice_read = generic_file_splice_read, + SPLICE_READ_INIT(generic_file_splice_read) };EXPORT_SYMBOL (generic_ro_fops);
Signature · 1 line
1.9.1
PATCH 51/56 drivers/char/mem: support compiling out splice
In reply to a message not in the archiveCompile out splice support from mem character driver when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
add/remove: 0/2 grow/shrink: 0/0 up/down: 0/-28 (-28)
function old new deltapipe_to_null 4 - -4splice_write_null 24 - -24
--- drivers/char/mem.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/char/mem.c +3 -1
@@ -610,6 +610,7 @@ static ssize_t aio_write_null(struct kiocb *iocb, const struct iovec *iov,return iov_length (iov, nr_segs); } +#ifdef CONFIG_SYSCALL_SPLICE static int pipe_to_null (struct pipe_inode_info *info,struct pipe_buffer *buf,struct splice_desc *sd) {
@@ -621,6 +622,7 @@ static ssize_t splice_write_null(struct pipe_inode_info *pipe, struct file *out, {return splice_from_pipe (pipe, out, ppos, len, flags, pipe_to_null); } +#endif /* #ifdef CONFIG_SYSCALL_SPLICE */ static ssize_t read_zero (struct file *file,char __user *buf,size_t count,loff_t *ppos)
@@ -769,7 +771,7 @@ static const struct file_operations null_fops = { .write = write_null, .aio_read = aio_read_null, .aio_write = aio_write_null, - .splice_write = splice_write_null, + SPLICE_WRITE_INIT(splice_write_null) };#ifdef CONFIG_DEVPORT
Signature · 1 line
1.9.1
Greg Kroah-Hartman
maintainerRe: [PATCH 51/56] drivers/char/mem: support compiling out splice
Quoted 27 lines · Pieter Smith
Compile out splice support from mem character driver when the splice-family of syscalls is not supported by the system (i.e.
CONFIG_SYSCALL_SPLICEis undefined).add/remove: 0/2 grow/shrink: 0/0 up/down: 0/-28 (-28)
function old new deltapipe_to_null4 - -4splice_write_null24 - -24Signed-off-by Pieter Smith <[email protected]>--- drivers/char/mem.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/char/mem.c +1
-0@@ -610,6 +610,7 @@ static ssize_t aio_write_null(struct kiocb *iocb, const struct iovec *iov,return iov_length (iov, nr_segs); } +#ifdef CONFIG_SYSCALL_SPLICE static int pipe_to_null (struct pipe_inode_info *info,struct pipe_buffer *buf,struct splice_desc *sd) {
drivers/char/mem.c static ssize_t splice_write_null(struct pipe_inode_info *pipe, struct file *out, · line 626
Quoted 5 lines
drivers/char/mem.c +1
-0@@ -621,6 +622,7 @@ static ssize_t splice_write_null(struct pipe_inode_info *pipe, struct file *out, {return splice_from_pipe (pipe, out, ppos, len, flags, pipe_to_null); } +#endif /* #ifdef CONFIG_SYSCALL_SPLICE */
Ick, no, not worth the #ifdef mess, sorry.
A message that is not in the archive (sent off-list or not yet received): CAPho-_JJGy0cwBVfWKL1Gt9ZQZM+Odo7W05bKQ2JLO+TM-ABJA@mail.gmail.com
Re: [PATCH 51/56] drivers/char/mem: support compiling out splice
[Please don't top-post.]
Quoted 2 lines · Pieter Smith
Okay with moving the relevant functions to a new translation unit and squashing it out in the
Makefile
No, you don't need to do that either. Mark pipe_to_null and splice_write_null as __maybe_unused, then wrap the initialization of .splice_write = splice_write_null to make it .splice_write = splice_p(splice_write_null). That will avoid adding a single ifdef.
- Josh Triplett
Greg Kroah-Hartman
maintainerRe: [PATCH 51/56] drivers/char/mem: support compiling out splice
Quoted 10 lines · On Thu, Nov 13, 2014 at 02:31:50PM -0800, [email protected] wrote:
[Please don't top-post.]
Quoted 2 lines · Pieter Smith
Okay with moving the relevant functions to a new translation unit and squashing it out in the
MakefileNo, you don't need to do that either. Mark
pipe_to_nullandsplice_write_nullas__maybe_unused, then wrap the initialization of .splice_write =splice_write_nullto make it .splice_write =splice_p(splice_write_null). That will avoid adding a single ifdef.
Again, ick, no. You aren't saving anything "real" at all, just take out the splice core code, leave the file pointer alone, and never do that horrid "splice_p" stuff, ick ick ick.
greg k-h
Re: [PATCH 51/56] drivers/char/mem: support compiling out splice
Quoted 7 lines · Greg Kroah-Hartman
Quoted 6 lines · On Thu, Nov 13, 2014 at 02:31:50PM -0800, [email protected] wrote:
[Please don't top-post.]
Quoted 2 lines · Pieter Smith
Okay with moving the relevant functions to a new translation unit and squashing it out in the
Makefile
Quoted 8 lines
Quoted 4 lines
No, you don't need to do that either. Mark
pipe_to_nullandsplice_write_nullas__maybe_unused, then wrap the initialization of .splice_write =splice_write_nullto make it .splice_write =splice_p(splice_write_null). That will avoid adding a single ifdef.Again, ick, no. You aren't saving anything "real" at all, just take out the splice core code, leave the file pointer alone, and never do that horrid "
splice_p" stuff, ick ick ick.
Without doing the splice_p change (which should add zero lines of code, total diffstat of -3+3 in this case, just a couple of __maybe_unused tokens and a splice_p() in the initializer), the actual splice implementations for filesystems and drivers won't get thrown away. I certainly agree that #ifdefs for those would be painful and not worth it. However, what problem would the proposed __maybe_unused / splice_p cause?
On the other hand, I can *definitely* understand not bothering with changing filesystems that nobody will use on a space-constrained system (e.g. cluster filesystems); the patch series could likely be narrowed to just a half-dozen likely filesystems and drivers, all of which could be done separately from the initial series removing the core splice code. Would that be more appealing?
- Josh Triplett
Greg Kroah-Hartman
maintainerRe: [PATCH 51/56] drivers/char/mem: support compiling out splice
Quoted 17 lines · On Thu, Nov 13, 2014 at 04:19:48PM -0800, [email protected] wrote:
Quoted 7 lines · Greg Kroah-Hartman
Quoted 6 lines · On Thu, Nov 13, 2014 at 02:31:50PM -0800, [email protected] wrote:
[Please don't top-post.]
Quoted 2 lines · Pieter Smith
Okay with moving the relevant functions to a new translation unit and squashing it out in the
MakefileQuoted 8 lines
Quoted 4 lines
No, you don't need to do that either. Mark
pipe_to_nullandsplice_write_nullas__maybe_unused, then wrap the initialization of .splice_write =splice_write_nullto make it .splice_write =splice_p(splice_write_null). That will avoid adding a single ifdef.Again, ick, no. You aren't saving anything "real" at all, just take out the splice core code, leave the file pointer alone, and never do that horrid "
splice_p" stuff, ick ick ick.
Quoted 7 lines
Without doing the
splice_pchange (which should add zero lines of code, total diffstat of -3+3 in this case, just a couple of__maybe_unusedtokens and asplice_p()in the initializer), the actual splice implementations for filesystems and drivers won't get thrown away. I certainly agree that #ifdefs for those would be painful and not worth it. However, what problem would the proposed__maybe_unused/splice_pcause?
I don't see what it buys you except churn and a constant need to keep fixing up code that doesn't use it as new drivers get added.
It's also "not normal" when compared to all of the other function pointers in the filesystem structure, what makes splice "special" here that everyone now needs to know it should be treated differently?
Quoted 6 lines
On the other hand, I can *definitely* understand not bothering with changing filesystems that nobody will use on a space-constrained system (e.g. cluster filesystems); the patch series could likely be narrowed to just a half-dozen likely filesystems and drivers, all of which could be done separately from the initial series removing the core splice code. Would that be more appealing?
As long as you aren't forcing every call-place to change, like this patch series did, it would be better.
Also, no one ever posted how much space savings overall there was here, so until that happens, I'm going to assume it isn't even worth the effort, right?
thanks,
greg k-h
A message that is not in the archive (sent off-list or not yet received): CAPho-_KUc-+c=X6xtLTD2F-o4qi+YpYdnw6F1cx4kniezfs7aw@mail.gmail.com
Re: [PATCH 51/56] drivers/char/mem: support compiling out splice
[Please don't top-post.]
Quoted 8 lines · Pieter Smith
Off course! You are right. Most savings are gained from compiling out
fs/splice.c. I'll eliminate file-system driver changes as far as possible.Turning splice exports into inline NOPs when splice is compiled out should keep me out of the file-systems.
The space savings are scattered over the patch-set. I'll make sure the next attempt includes it in the cover-letter.
I'd suggest including the results from scripts/bloat-o-meter in the cover letter next time.
- Josh Triplett
A message that is not in the archive (sent off-list or not yet received): CAPho-_LCj7bxJ2EvuZtBZXD1buH1V+nKEiobTJUATYmGYVRWcA@mail.gmail.com
Re: [PATCH 51/56] drivers/char/mem: support compiling out splice
[Please don't top-post.]
Quoted 9 lines · Pieter Smith
I had a look at the numbers (see below): For a tinyconfig kernel, savings outside
fs/splice.care negligible. With the addition of networking however, net/core and net/ipv4 can be squeezed for usable savings.Should I leave networking (and the rest) until we can come up with a non-icky approach outside
fs/splice.c?*THE NUMBERS*
Quoted 7 lines
Given a tinyconfig,
fs/splice.ccan free up 8.2K (3.5K + 4.7K) withCONFIG_SYSCALL_SPLICE. The rest are not worth the effort:
fs/splice:syscalls only: add/remove: 0/16 grow/shrink: 2/5 up/down: 114/-3693 (-3579) the remainder: add/remove: 0/24 grow/shrink: 0/4 up/down: 0/-4824(-4824)
Nice!
Go ahead and submit the patches for that portion, and the rest can wait until we get compiler support for omitting structure fields.
- Josh Triplett
A message that is not in the archive (sent off-list or not yet received): CAPho-_+ZXHYGB9-d19NR9u5tcOpN1Ytg80NZgvScF=YQ-6SdNA@mail.gmail.com
Re: [PATCH 51/56] drivers/char/mem: support compiling out splice
Quoted 7 lines · Pieter Smith
Turning all exported splice functions into static inline NOP's covers almost everything...
fs/fuse and net/skbuf use an exported ops struct fromfs/splice.c. Mocking out an exported ops struct seems way uglier than linking out the dependencies with a__splice_p()macro and__maybe_unused.Any thoughts or suggestions?
You could make FUSE select SPLICE_SYSCALL.
For skbuff, what's the dependency? Ideally NET shouldn't select SPLICE_SYSCALL. You might try compiling out *only* that particular instance, and seeing how clean you can make that.
- Josh Triplett
PATCH 52/56 drivers/char/virtio: support compiling out splice
In reply to a message not in the archiveCompile out splice support from virtio character driver when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- drivers/char/virtio_console.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/char/virtio_console.c +3 -1
@@ -870,6 +870,7 @@ struct sg_list {struct scatterlist *sg; }; +#ifdef CONFIG_SYSCALL_SPLICE static int pipe_to_sg (struct pipe_inode_info *pipe,struct pipe_buffer *buf,struct splice_desc *sd) {
@@ -976,6 +977,7 @@ error_out:pipe_unlock (pipe); return ret; } +#endif /* #ifdef CONFIG_SYSCALL_SPLICE */ static unsigned int port_fops_poll (struct file *filp,poll_table *wait) {
@@ -1109,7 +1111,7 @@ static const struct file_operations port_fops = { .open = port_fops_open, .read = port_fops_read, .write = port_fops_write, - .splice_write = port_fops_splice_write, +SPLICE_WRITE_INIT (port_fops_splice_write) .poll = port_fops_poll, .release = port_fops_release, .fasync = port_fops_fasync,
Signature · 1 line
1.9.1
PATCH 52/56 drivers/char/virtio: support compiling out splice
In reply to a message not in the archiveCompile out splice support from virtio character driver when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- drivers/char/virtio_console.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/char/virtio_console.c +3 -1
@@ -870,6 +870,7 @@ struct sg_list {struct scatterlist *sg; }; +#ifdef CONFIG_SYSCALL_SPLICE static int pipe_to_sg (struct pipe_inode_info *pipe,struct pipe_buffer *buf,struct splice_desc *sd) {
@@ -976,6 +977,7 @@ error_out:pipe_unlock (pipe); return ret; } +#endif /* #ifdef CONFIG_SYSCALL_SPLICE */ static unsigned int port_fops_poll (struct file *filp,poll_table *wait) {
@@ -1109,7 +1111,7 @@ static const struct file_operations port_fops = { .open = port_fops_open, .read = port_fops_read, .write = port_fops_write, - .splice_write = port_fops_splice_write, +SPLICE_WRITE_INIT (port_fops_splice_write) .poll = port_fops_poll, .release = port_fops_release, .fasync = port_fops_fasync,
Signature · 1 line
1.9.1
Greg Kroah-Hartman
maintainerRe: [PATCH 52/56] drivers/char/virtio: support compiling out splice
Quoted 22 lines · Pieter Smith
Compile out splice support from virtio character driver when the splice-family of syscalls is not supported by the system (i.e.
CONFIG_SYSCALL_SPLICEis undefined).Signed-off-by Pieter Smith <[email protected]>--- drivers/char/virtio_console.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/char/virtio_console.c +1
-0@@ -870,6 +870,7 @@ struct sg_list {struct scatterlist *sg; }; +#ifdef CONFIG_SYSCALL_SPLICE static int pipe_to_sg (struct pipe_inode_info *pipe,struct pipe_buffer *buf,struct splice_desc *sd) {
drivers/char/virtio_console.c error_out: · line 980
Quoted 4 lines
drivers/char/virtio_console.c +1
-0@@ -976,6 +977,7 @@ error_out:pipe_unlock (pipe); return ret; } +#endif /* #ifdef CONFIG_SYSCALL_SPLICE */
Not worth the #ifdef mess.
PATCH 53/56 net/ipv6: support compiling out splice
In reply to a message not in the archiveCompile out splice support from ipv6 networking when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- net/ipv6/af_inet6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/af_inet6.c +1 -1
@@ -523,7 +523,7 @@ const struct proto_ops inet6_stream_ops = { .recvmsg = inet_recvmsg, /* ok */ .mmap = sock_no_mmap, .sendpage = inet_sendpage, - .splice_read = tcp_splice_read, + SPLICE_READ_INIT(tcp_splice_read) #ifdef CONFIG_COMPAT .compat_setsockopt = compat_sock_common_setsockopt, .compat_getsockopt = compat_sock_common_getsockopt,
Signature · 1 line
1.9.1
PATCH 54/56 net/ipv4: support compiling out splice
In reply to a message not in the archiveCompile out splice support from ipv4 networking when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- net/ipv4/af_inet.c | 2 +- net/ipv4/tcp.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
net/ipv4/af_inet.c +1 -1
@@ -917,7 +917,7 @@ const struct proto_ops inet_stream_ops = { .recvmsg = inet_recvmsg, .mmap = sock_no_mmap, .sendpage = inet_sendpage, - .splice_read = tcp_splice_read, + SPLICE_READ_INIT(tcp_splice_read) #ifdef CONFIG_COMPAT .compat_setsockopt = compat_sock_common_setsockopt, .compat_getsockopt = compat_sock_common_getsockopt,
net/ipv4/tcp.c +2 -0
@@ -686,6 +686,7 @@ static void tcp_push(struct sock *sk, int flags, int mss_now,__tcp_push_pending_frames (sk, mss_now, nonagle); } +#ifdef CONFIG_SYSCALL_SPLICE static int tcp_splice_data_recv (read_descriptor_t *rd_desc,struct sk_buff *skb,unsigned int offset,size_t len) {
@@ -805,6 +806,7 @@ ssize_t tcp_splice_read(struct socket *sock, loff_t *ppos, return ret; }EXPORT_SYMBOL (tcp_splice_read); +#endif /* #ifdef CONFIG_SYSCALL_SPLICE */ struct sk_buff *sk_stream_alloc_skb (struct sock *sk,int size,gfp_t gfp) {
Signature · 1 line
1.9.1
PATCH 55/56 net/core: support compiling out splice
In reply to a message not in the archiveCompile out splice support from networking core when the splice-family of syscalls is not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
--- include/linux/skbuff.h | 2 ++ net/core/skbuff.c | 2 ++ 2 files changed, 4 insertions(+)
include/linux/skbuff.h +2 -0
@@ -2543,9 +2543,11 @@ int skb_copy_bits(const struct sk_buff *skb, int offset, void *to, int len);int skb_store_bits (struct sk_buff *skb,int offset,const void *from,int len);__wsum skb_copy_and_csum_bits (const struct sk_buff *skb,int offset,u8 *to,int len,__wsum csum); +#ifdef CONFIG_SYSCALL_SPLICE int skb_splice_bits (struct sk_buff *skb,unsigned int offset,struct pipe_inode_info *pipe,unsigned int len,unsigned int flags); +#endif /* #ifdef CONFIG_SYSCALL_SPLICE */ void skb_copy_and_csum_dev (const struct sk_buff *skb,u8 *to);unsigned int skb_zerocopy_headlen (const struct sk_buff *from); int skb_zerocopy(struct sk_buff *to, struct sk_buff *from,
net/core/skbuff.c +2 -0
@@ -1649,6 +1649,7 @@ fault: }EXPORT_SYMBOL (skb_copy_bits); +#ifdef CONFIG_SYSCALL_SPLICE /* * Callback from splice_to_pipe(), if we need to release some pages * at the end of the spd in case we error'ed out in filling the pipe.
@@ -1851,6 +1852,7 @@ done: return ret; } +#endif /* #ifdef CONFIG_SYSCALL_SPLICE */ /** * skb_store_bits - store bits from kernel buffer to skb
Signature · 1 line
1.9.1
PATCH 56/56 fs/splice: full support for compiling out splice
In reply to a message not in the archiveEntirely compile out splice translation unit when the system is configured without splice family of syscalls (i.e. CONFIG_SYSCALL_SPLICE is undefined).
add/remove: 0/26 grow/shrink: 0/22 up/down: 0/-5001 (-5001)
function old new delta
generic_pipe_buf_nosteal 6 - -6 zero_fops 116 108 -8 urandom_fops 116 108 -8 simple_dir_operations 116 108 -8 random_fops 116 108 -8 ramfs_file_operations 116 108 -8 posix_clock_file_operations 116 108 -8 pm_qos_power_fops 116 108 -8 pipefifo_fops 116 108 -8 perf_fops 116 108 -8 null_fops 116 108 -8 misc_fops 116 108 -8 memory_fops 116 108 -8 mem_fops 116 108 -8 generic_ro_fops 116 108 -8 full_fops 116 108 -8 def_chr_fops 116 108 -8 def_blk_fops 116 108 -8 bad_sock_fops 116 108 -8 bad_file_ops 116 108 -8 spd_release_page 10 - -10 PageUptodate 22 11 -11 lock_page 36 24 -12 page_cache_pipe_buf_release 16 - -16 empty_fops 232 216 -16 page_cache_pipe_buf_ops 20 - -20 nosteal_pipe_buf_ops 20 - -20 default_pipe_buf_ops 20 - -20 generic_splice_sendpage 24 - -24 splice_shrink_spd 27 - -27 direct_splice_actor 47 - -47 default_file_splice_write 49 - -49 wakeup_pipe_writers 54 - -54 write_pipe_buf 71 - -71 page_cache_pipe_buf_confirm 80 - -80 splice_grow_spd 87 - -87 splice_from_pipe 93 - -93 splice_from_pipe_next 106 - -106 pipe_to_sendpage 109 - -109 page_cache_pipe_buf_steal 114 - -114 generic_file_splice_read 131 - -131 do_splice_direct 148 - -148 __splice_from_pipe 246 - -246 splice_direct_to_actor 416 - -416 splice_to_pipe 417 - -417 default_file_splice_read 688 - -688 iter_file_splice_write 702 - -702 __generic_file_splice_read 1109 - -1109
--- drivers/block/Kconfig | 1 + fs/Makefile | 4 +++- fs/splice.c | 2 -- include/linux/fs.h | 4 ++++ include/linux/splice.h | 3 +++ 5 files changed, 11 insertions(+), 3 deletions(-)
drivers/block/Kconfig +1 -0
@@ -210,6 +210,7 @@ config BLK_DEV_COW_COMMON config BLK_DEV_LOOP tristate "Loopback device support" + depends on SYSCALL_SPLICE ---help--- Saying Y here will allow you to use a regular file as a block device; you can then create a file system on that block device and
fs/Makefile +3 -1
@@ -10,7 +10,7 @@ obj-y := open.o read_write.o file_table.o super.o \ ioctl.o readdir.o select.o dcache.o inode.o \ attr.o bad_inode.o file.o filesystems.o namespace.o \ seq_file.o xattr.o libfs.o fs-writeback.o \ - pnode.o splice.o sync.o utimes.o \ + pnode.o sync.o utimes.o \ stack.o fs_struct.o statfs.o fs_pin.o ifeq ($(CONFIG_BLOCK),y)
@@ -21,6 +21,8 @@ endif obj-$(CONFIG_PROC_FS) += proc_namespace.o +obj-$(CONFIG_SYSCALL_SPLICE) += splice.o + obj-y += notify/ obj-$(CONFIG_EPOLL) += eventpoll.o obj-$(CONFIG_ANON_INODES) += anon_inodes.o
fs/splice.c +0 -2
@@ -1316,7 +1316,6 @@ long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,return ret; } -#ifdef CONFIG_SYSCALL_SPLICE static int splice_pipe_to_pipe (struct pipe_inode_info *ipipe,struct pipe_inode_info *opipe,size_t len,unsigned int flags);
@@ -2201,5 +2200,4 @@ COMPAT_SYSCALL_DEFINE4(sendfile64, int, out_fd, int, in_fd, return do_sendfile(out_fd, in_fd, NULL, count, 0); }#endif -#endif
include/linux/fs.h +4 -0
@@ -1504,8 +1504,10 @@ struct file_operations {unsigned long (*get_unmapped_area)(struct file *,unsigned long ,unsigned long ,unsigned long ,unsigned long );int (*check_flags)(int );int (*flock) (struct file *,int ,struct file_lock *); +#ifdef CONFIG_SYSCALL_SPLICE ssize_t (*splice_write)(struct pipe_inode_info *,struct file *,loff_t *,size_t ,unsigned int );ssize_t (*splice_read)(struct file *,loff_t *,struct pipe_inode_info *,size_t ,unsigned int ); +#endif /* #ifdef CONFIG_SYSCALL_SPLICE */ int (*setlease)(struct file *,long ,struct file_lock **);long (*fallocate)(struct file *file,int mode,loff_t offset,loff_t len);
@@ -2486,6 +2488,7 @@ extern int blkdev_fsync(struct file *filp, loff_t start, loff_t end, int datasync);extern void block_sync_page (struct page *page); +#ifdef CONFIG_SYSCALL_SPLICE /* fs/splice.c */ extern ssize_t generic_file_splice_read (struct file *,loff_t *,struct pipe_inode_info *,size_t ,unsigned int );
@@ -2495,6 +2498,7 @@ extern ssize_t iter_file_splice_write(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);extern ssize_t generic_splice_sendpage (struct pipe_inode_info *pipe,struct file *out,loff_t *,size_t len,unsigned int flags); +#endif extern void file_ra_state_init (struct file_ra_state *ra,struct address_space *mapping);
include/linux/splice.h +3 -0
@@ -10,6 +10,7 @@#include <linux/pipe_fs_i.h> +#ifdef CONFIG_SYSCALL_SPLICE /* * Flags passed in from splice/tee/vmsplice */
@@ -83,4 +84,6 @@ extern void splice_shrink_spd(struct splice_pipe_desc *);extern void spd_release_page (struct splice_pipe_desc *,unsigned int );extern const struct pipe_buf_operations page_cache_pipe_buf_ops; +#endif /* #ifdef CONFIG_SYSCALL_SPLICE */ +#endif
Signature · 1 line
1.9.1