[PATCH 6/6] fs/splice: full support for compiling out splice

2014-11-23 Thread Pieter Smith
Entirely compile out splice translation unit when the system is configured
without splice family of syscalls (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Exported fs/splice functions are transparently mocked out with static inlines.
Because userspace support for splice has already been removed by this
patch-set, the exported functions cannot be called anyway. Mocking them out
prevents a maintenance burden on file system drivers.

The bloat score resulting from this patch given a tinyconfig is:
add/remove: 0/25 grow/shrink: 0/5 up/down: 0/-4845 (-4845)
function old new   delta
pipe_to_null   4   -  -4
generic_pipe_buf_nosteal   6   -  -6
spd_release_page  10   - -10
PageUptodate  22  11 -11
lock_page 36  24 -12
page_cache_pipe_buf_release   16   - -16
splice_write_null 24   4 -20
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_buf71   - -71
page_cache_pipe_buf_confirm   80   - -80
splice_grow_spd   87   - -87
splice_from_pipe  93   - -93
splice_from_pipe_next106   --106
pipe_to_sendpage 109   --109
page_cache_pipe_buf_steal114   --114
generic_file_splice_read 131   8-123
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   4-698
__generic_file_splice_read  1109   -   -1109

The bloat score for the entire CONFIG_SYSCALL_SPLICE patch-set is:
add/remove: 0/41 grow/shrink: 5/7 up/down: 23/-8422 (-8399)
function old new   delta
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
pipe_to_null   4   -  -4
generic_pipe_buf_nosteal   6   -  -6
spd_release_page  10   - -10
fdput 11   - -11
PageUptodate  22  11 -11
lock_page 36  24 -12
signal_pending39  26 -13
fdget 56  42 -14
page_cache_pipe_buf_release   16   - -16
user_page_pipe_buf_ops20   - -20
splice_write_null 24   4 -20
page_cache_pipe_buf_ops   20   - -20
nosteal_pipe_buf_ops  20   - -20
default_pipe_buf_ops  20   - -20
generic_splice_sendpage   24   - -24
user_page_pipe_buf_steal  25   - -25
splice_shrink_spd 27   - -27
pipe_to_user  43   - -43
direct_splice_actor   47   - -47
default_file_splice_write 49   - -49
wakeup_pipe_writers   54   - -54
wakeup_pipe_readers   54   - -54
write_pipe_buf71   - -71
page_cache_pipe_buf_confirm   80   - -80
splice_grow_spd   87   - -87
do_splice_to  87   - -87
ipipe_prep.part   92   - -92
splice_from_pipe  93   - -93
splice_from_pipe_next107   --107
pipe_to_sendpage

[PATCH 6/6] fs/splice: full support for compiling out splice

2014-11-23 Thread Pieter Smith
Entirely compile out splice translation unit when the system is configured
without splice family of syscalls (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Exported fs/splice functions are transparently mocked out with static inlines.
Because userspace support for splice has already been removed by this
patch-set, the exported functions cannot be called anyway. Mocking them out
prevents a maintenance burden on file system drivers.

The bloat score resulting from this patch given a tinyconfig is:
add/remove: 0/25 grow/shrink: 0/5 up/down: 0/-4845 (-4845)
function old new   delta
pipe_to_null   4   -  -4
generic_pipe_buf_nosteal   6   -  -6
spd_release_page  10   - -10
PageUptodate  22  11 -11
lock_page 36  24 -12
page_cache_pipe_buf_release   16   - -16
splice_write_null 24   4 -20
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_buf71   - -71
page_cache_pipe_buf_confirm   80   - -80
splice_grow_spd   87   - -87
splice_from_pipe  93   - -93
splice_from_pipe_next106   --106
pipe_to_sendpage 109   --109
page_cache_pipe_buf_steal114   --114
generic_file_splice_read 131   8-123
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   4-698
__generic_file_splice_read  1109   -   -1109

The bloat score for the entire CONFIG_SYSCALL_SPLICE patch-set is:
add/remove: 0/41 grow/shrink: 5/7 up/down: 23/-8422 (-8399)
function old new   delta
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
pipe_to_null   4   -  -4
generic_pipe_buf_nosteal   6   -  -6
spd_release_page  10   - -10
fdput 11   - -11
PageUptodate  22  11 -11
lock_page 36  24 -12
signal_pending39  26 -13
fdget 56  42 -14
page_cache_pipe_buf_release   16   - -16
user_page_pipe_buf_ops20   - -20
splice_write_null 24   4 -20
page_cache_pipe_buf_ops   20   - -20
nosteal_pipe_buf_ops  20   - -20
default_pipe_buf_ops  20   - -20
generic_splice_sendpage   24   - -24
user_page_pipe_buf_steal  25   - -25
splice_shrink_spd 27   - -27
pipe_to_user  43   - -43
direct_splice_actor   47   - -47
default_file_splice_write 49   - -49
wakeup_pipe_writers   54   - -54
wakeup_pipe_readers   54   - -54
write_pipe_buf71   - -71
page_cache_pipe_buf_confirm   80   - -80
splice_grow_spd   87   - -87
do_splice_to  87   - -87
ipipe_prep.part   92   - -92
splice_from_pipe  93   - -93
splice_from_pipe_next107   --107
pipe_to_sendpage

Re: [PATCH 6/6] fs/splice: full support for compiling out splice

2014-11-22 Thread Josh Triplett
On Sat, Nov 22, 2014 at 10:00:01PM +0100, Pieter Smith wrote:
> Entirely 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/25 grow/shrink: 0/5 up/down: 0/-4845 (-4845)

Very nice!

- Josh Triplett

> function old new   delta
> pipe_to_null   4   -  -4
> generic_pipe_buf_nosteal   6   -  -6
> spd_release_page  10   - -10
> PageUptodate  22  11 -11
> lock_page 36  24 -12
> page_cache_pipe_buf_release   16   - -16
> splice_write_null 24   4 -20
> 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_buf71   - -71
> page_cache_pipe_buf_confirm   80   - -80
> splice_grow_spd   87   - -87
> splice_from_pipe  93   - -93
> splice_from_pipe_next106   --106
> pipe_to_sendpage 109   --109
> page_cache_pipe_buf_steal114   --114
> generic_file_splice_read 131   8-123
> 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   4-698
> __generic_file_splice_read  1109   -   -1109
> 
> Signed-off-by: Pieter Smith 
> ---
>  fs/Makefile|  3 ++-
>  fs/splice.c|  2 --
>  include/linux/fs.h | 26 ++
>  include/linux/splice.h | 43 +++
>  4 files changed, 71 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/Makefile b/fs/Makefile
> index fb7646e..9395622 100644
> --- a/fs/Makefile
> +++ b/fs/Makefile
> @@ -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)
> @@ -22,6 +22,7 @@ endif
>  obj-$(CONFIG_PROC_FS) += proc_namespace.o
>  
>  obj-$(CONFIG_FSNOTIFY)   += notify/
> +obj-$(CONFIG_SYSCALL_SPLICE) += splice.o
>  obj-$(CONFIG_EPOLL)  += eventpoll.o
>  obj-$(CONFIG_ANON_INODES)+= anon_inodes.o
>  obj-$(CONFIG_SIGNALFD)   += signalfd.o
> diff --git a/fs/splice.c b/fs/splice.c
> index 7c4c695..44b201b 100644
> --- a/fs/splice.c
> +++ b/fs/splice.c
> @@ -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
>  
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 04c0975..9b3054e 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -2449,6 +2449,7 @@ extern void block_sync_page(struct page *page);
>  #define __splice_p(x) NULL
>  #endif
>  
> +#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);
> @@ -2458,6 +2459,31 @@ 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);
> +#else
> +static inline ssize_t 

[PATCH 6/6] fs/splice: full support for compiling out splice

2014-11-22 Thread Pieter Smith
Entirely 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/25 grow/shrink: 0/5 up/down: 0/-4845 (-4845)
function old new   delta
pipe_to_null   4   -  -4
generic_pipe_buf_nosteal   6   -  -6
spd_release_page  10   - -10
PageUptodate  22  11 -11
lock_page 36  24 -12
page_cache_pipe_buf_release   16   - -16
splice_write_null 24   4 -20
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_buf71   - -71
page_cache_pipe_buf_confirm   80   - -80
splice_grow_spd   87   - -87
splice_from_pipe  93   - -93
splice_from_pipe_next106   --106
pipe_to_sendpage 109   --109
page_cache_pipe_buf_steal114   --114
generic_file_splice_read 131   8-123
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   4-698
__generic_file_splice_read  1109   -   -1109

Signed-off-by: Pieter Smith 
---
 fs/Makefile|  3 ++-
 fs/splice.c|  2 --
 include/linux/fs.h | 26 ++
 include/linux/splice.h | 43 +++
 4 files changed, 71 insertions(+), 3 deletions(-)

diff --git a/fs/Makefile b/fs/Makefile
index fb7646e..9395622 100644
--- a/fs/Makefile
+++ b/fs/Makefile
@@ -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)
@@ -22,6 +22,7 @@ endif
 obj-$(CONFIG_PROC_FS) += proc_namespace.o
 
 obj-$(CONFIG_FSNOTIFY) += notify/
+obj-$(CONFIG_SYSCALL_SPLICE)   += splice.o
 obj-$(CONFIG_EPOLL)+= eventpoll.o
 obj-$(CONFIG_ANON_INODES)  += anon_inodes.o
 obj-$(CONFIG_SIGNALFD) += signalfd.o
diff --git a/fs/splice.c b/fs/splice.c
index 7c4c695..44b201b 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -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
 
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 04c0975..9b3054e 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2449,6 +2449,7 @@ extern void block_sync_page(struct page *page);
 #define __splice_p(x) NULL
 #endif
 
+#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);
@@ -2458,6 +2459,31 @@ 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);
+#else
+static inline ssize_t generic_file_splice_read(struct file *in, loff_t *ppos,
+   struct pipe_inode_info *pipe, size_t len, unsigned int flags)
+{
+   return -EPERM;
+}
+
+static inline ssize_t default_file_splice_read(struct file *in, loff_t *ppos,
+   struct pipe_inode_info *pipe, 

[PATCH 6/6] fs/splice: full support for compiling out splice

2014-11-22 Thread Pieter Smith
Entirely 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/25 grow/shrink: 0/5 up/down: 0/-4845 (-4845)
function old new   delta
pipe_to_null   4   -  -4
generic_pipe_buf_nosteal   6   -  -6
spd_release_page  10   - -10
PageUptodate  22  11 -11
lock_page 36  24 -12
page_cache_pipe_buf_release   16   - -16
splice_write_null 24   4 -20
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_buf71   - -71
page_cache_pipe_buf_confirm   80   - -80
splice_grow_spd   87   - -87
splice_from_pipe  93   - -93
splice_from_pipe_next106   --106
pipe_to_sendpage 109   --109
page_cache_pipe_buf_steal114   --114
generic_file_splice_read 131   8-123
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   4-698
__generic_file_splice_read  1109   -   -1109

Signed-off-by: Pieter Smith pie...@boesman.nl
---
 fs/Makefile|  3 ++-
 fs/splice.c|  2 --
 include/linux/fs.h | 26 ++
 include/linux/splice.h | 43 +++
 4 files changed, 71 insertions(+), 3 deletions(-)

diff --git a/fs/Makefile b/fs/Makefile
index fb7646e..9395622 100644
--- a/fs/Makefile
+++ b/fs/Makefile
@@ -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)
@@ -22,6 +22,7 @@ endif
 obj-$(CONFIG_PROC_FS) += proc_namespace.o
 
 obj-$(CONFIG_FSNOTIFY) += notify/
+obj-$(CONFIG_SYSCALL_SPLICE)   += splice.o
 obj-$(CONFIG_EPOLL)+= eventpoll.o
 obj-$(CONFIG_ANON_INODES)  += anon_inodes.o
 obj-$(CONFIG_SIGNALFD) += signalfd.o
diff --git a/fs/splice.c b/fs/splice.c
index 7c4c695..44b201b 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -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
 
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 04c0975..9b3054e 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2449,6 +2449,7 @@ extern void block_sync_page(struct page *page);
 #define __splice_p(x) NULL
 #endif
 
+#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);
@@ -2458,6 +2459,31 @@ 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);
+#else
+static inline ssize_t generic_file_splice_read(struct file *in, loff_t *ppos,
+   struct pipe_inode_info *pipe, size_t len, unsigned int flags)
+{
+   return -EPERM;
+}
+
+static inline ssize_t default_file_splice_read(struct file *in, loff_t *ppos,
+   struct 

Re: [PATCH 6/6] fs/splice: full support for compiling out splice

2014-11-22 Thread Josh Triplett
On Sat, Nov 22, 2014 at 10:00:01PM +0100, Pieter Smith wrote:
 Entirely 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/25 grow/shrink: 0/5 up/down: 0/-4845 (-4845)

Very nice!

- Josh Triplett

 function old new   delta
 pipe_to_null   4   -  -4
 generic_pipe_buf_nosteal   6   -  -6
 spd_release_page  10   - -10
 PageUptodate  22  11 -11
 lock_page 36  24 -12
 page_cache_pipe_buf_release   16   - -16
 splice_write_null 24   4 -20
 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_buf71   - -71
 page_cache_pipe_buf_confirm   80   - -80
 splice_grow_spd   87   - -87
 splice_from_pipe  93   - -93
 splice_from_pipe_next106   --106
 pipe_to_sendpage 109   --109
 page_cache_pipe_buf_steal114   --114
 generic_file_splice_read 131   8-123
 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   4-698
 __generic_file_splice_read  1109   -   -1109
 
 Signed-off-by: Pieter Smith pie...@boesman.nl
 ---
  fs/Makefile|  3 ++-
  fs/splice.c|  2 --
  include/linux/fs.h | 26 ++
  include/linux/splice.h | 43 +++
  4 files changed, 71 insertions(+), 3 deletions(-)
 
 diff --git a/fs/Makefile b/fs/Makefile
 index fb7646e..9395622 100644
 --- a/fs/Makefile
 +++ b/fs/Makefile
 @@ -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)
 @@ -22,6 +22,7 @@ endif
  obj-$(CONFIG_PROC_FS) += proc_namespace.o
  
  obj-$(CONFIG_FSNOTIFY)   += notify/
 +obj-$(CONFIG_SYSCALL_SPLICE) += splice.o
  obj-$(CONFIG_EPOLL)  += eventpoll.o
  obj-$(CONFIG_ANON_INODES)+= anon_inodes.o
  obj-$(CONFIG_SIGNALFD)   += signalfd.o
 diff --git a/fs/splice.c b/fs/splice.c
 index 7c4c695..44b201b 100644
 --- a/fs/splice.c
 +++ b/fs/splice.c
 @@ -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
  
 diff --git a/include/linux/fs.h b/include/linux/fs.h
 index 04c0975..9b3054e 100644
 --- a/include/linux/fs.h
 +++ b/include/linux/fs.h
 @@ -2449,6 +2449,7 @@ extern void block_sync_page(struct page *page);
  #define __splice_p(x) NULL
  #endif
  
 +#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);
 @@ -2458,6 +2459,31 @@ 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);
 +#else
 +static inline ssize_t generic_file_splice_read(struct file *in, loff_t *ppos,
 + struct pipe_inode_info