linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/56] moved sendfile syscall to splice translation unit
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
@ 2014-11-13 21:22 ` Pieter Smith
  2014-11-13 21:22 ` [PATCH 02/56] moved kernel_write out of " Pieter Smith
                   ` (54 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:22 UTC (permalink / raw)
  To: pieter; +Cc: Josh Triplett, Alexander Viro, linux-fsdevel, open list

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

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/read_write.c | 175 -------------------------------------------------------
 fs/splice.c     | 178 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 178 insertions(+), 175 deletions(-)

diff --git a/fs/read_write.c b/fs/read_write.c
index 009d854..3f7f04d 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -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
diff --git a/fs/splice.c b/fs/splice.c
index f5cb9ba..c1a2861 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -28,6 +28,7 @@
 #include <linux/export.h>
 #include <linux/syscalls.h>
 #include <linux/uio.h>
+#include <linux/fsnotify.h>
 #include <linux/security.h>
 #include <linux/gfp.h>
 #include <linux/socket.h>
@@ -2039,3 +2040,180 @@ SYSCALL_DEFINE4(tee, int, fdin, int, fdout, size_t, len, unsigned int, flags)
 
 	return error;
 }
+
+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
+
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 02/56] moved kernel_write out of splice translation unit
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
  2014-11-13 21:22 ` [PATCH 01/56] moved sendfile syscall to splice translation unit Pieter Smith
@ 2014-11-13 21:22 ` Pieter Smith
  2014-11-13 21:22 ` [PATCH 03/56] fs: Support compiling out splice-family syscalls Pieter Smith
                   ` (53 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:22 UTC (permalink / raw)
  To: pieter; +Cc: Josh Triplett, Alexander Viro, linux-fsdevel, open list

kernel_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.

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/read_write.c | 16 ++++++++++++++++
 fs/splice.c     | 16 ----------------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/fs/read_write.c b/fs/read_write.c
index 3f7f04d..4361261 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -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);
+
diff --git a/fs/splice.c b/fs/splice.c
index c1a2861..44b201b 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -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)
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 03/56] fs: Support compiling out splice-family syscalls
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
  2014-11-13 21:22 ` [PATCH 01/56] moved sendfile syscall to splice translation unit Pieter Smith
  2014-11-13 21:22 ` [PATCH 02/56] moved kernel_write out of " Pieter Smith
@ 2014-11-13 21:22 ` Pieter Smith
  2014-11-13 21:22 ` [PATCH 04/56] fs: Macros to define splice file_operations Pieter Smith
                   ` (52 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:22 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, Alexander Viro, Andrew Morton, Matt Turner,
	Michal Hocko, Fabian Frederick, Paul Gortmaker, Tejun Heo,
	Paul E. McKenney, Luis R. Rodriguez, Peter Foley,
	Eric W. Biederman, Oleg Nesterov, H. Peter Anvin,
	Andy Lutomirski, Vivek Goyal, David Herrmann, Kees Cook,
	Mailing List, open list, open list:ABI/API

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

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/splice.c     |  2 ++
 init/Kconfig    | 10 ++++++++++
 kernel/sys_ni.c |  8 ++++++++
 3 files changed, 20 insertions(+)

diff --git a/fs/splice.c b/fs/splice.c
index 44b201b..7c4c695 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -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
 
diff --git a/init/Kconfig b/init/Kconfig
index 782a65b..25ee289 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -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
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c
index d4709d4..2913337 100644
--- a/kernel/sys_ni.c
+++ b/kernel/sys_ni.c
@@ -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);
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 04/56] fs: Macros to define splice file_operations
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (2 preceding siblings ...)
  2014-11-13 21:22 ` [PATCH 03/56] fs: Support compiling out splice-family syscalls Pieter Smith
@ 2014-11-13 21:22 ` Pieter Smith
  2014-11-13 21:49   ` Richard Weinberger
  2014-11-13 21:51   ` Al Viro
  2014-11-13 21:22 ` [PATCH 05/56] fs/lustre: support compiling out splice Pieter Smith
                   ` (51 subsequent siblings)
  55 siblings, 2 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:22 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, Jeff Layton, J. Bruce Fields, linux-fsdevel, open list

Provides 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

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 include/linux/fs.h | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/include/linux/fs.h b/include/linux/fs.h
index 9418772..a88de9f 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -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 *);
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 05/56] fs/lustre: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (3 preceding siblings ...)
  2014-11-13 21:22 ` [PATCH 04/56] fs: Macros to define splice file_operations Pieter Smith
@ 2014-11-13 21:22 ` Pieter Smith
  2014-11-13 22:09   ` Greg Kroah-Hartman
  2014-11-13 21:22 ` [PATCH 06/56] fs/adfs: " Pieter Smith
                   ` (50 subsequent siblings)
  55 siblings, 1 reply; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:22 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, Greg Kroah-Hartman, Oleg Drokin, Andreas Dilger,
	Peng Tao, Jinshan Xiong, John L. Hammond, JC Lafoucriere,
	Al Viro, Andrew Perepechko, Dmitry Eremin, Lai Siyao, Li Xi,
	Masanari Iida, open list:STAGING SUBSYSTEM, open list

Compile 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).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 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(-)

diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c
index fd1b75a3..98573da 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -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,
diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h
index 634ffa6..44fa32a 100644
--- a/drivers/staging/lustre/lustre/llite/llite_internal.h
+++ b/drivers/staging/lustre/lustre/llite/llite_internal.h
@@ -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 */
diff --git a/drivers/staging/lustre/lustre/llite/vvp_io.c b/drivers/staging/lustre/lustre/llite/vvp_io.c
index a4117d6..2f4aa39 100644
--- a/drivers/staging/lustre/lustre/llite/vvp_io.c
+++ b/drivers/staging/lustre/lustre/llite/vvp_io.c
@@ -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();
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 06/56] fs/adfs: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (4 preceding siblings ...)
  2014-11-13 21:22 ` [PATCH 05/56] fs/lustre: support compiling out splice Pieter Smith
@ 2014-11-13 21:22 ` Pieter Smith
  2014-11-13 21:22 ` [PATCH 07/56] fs/affs: " Pieter Smith
                   ` (49 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:22 UTC (permalink / raw)
  To: pieter; +Cc: Josh Triplett, Al Viro, open list

Compile out splice support from adfs when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/adfs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/adfs/file.c b/fs/adfs/file.c
index 07c9edc..d7b19ab 100644
--- a/fs/adfs/file.c
+++ b/fs/adfs/file.c
@@ -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 = {
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 07/56] fs/affs: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (5 preceding siblings ...)
  2014-11-13 21:22 ` [PATCH 06/56] fs/adfs: " Pieter Smith
@ 2014-11-13 21:22 ` Pieter Smith
  2014-11-13 21:22 ` [PATCH 08/56] fs/afs: " Pieter Smith
                   ` (48 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:22 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, Andrew Morton, Fabian Frederick, Al Viro,
	open list:AFFS FILE SYSTEM, open list

Compile out splice support from affs when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/affs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/affs/file.c b/fs/affs/file.c
index a7fe57d..8c2752d 100644
--- a/fs/affs/file.c
+++ b/fs/affs/file.c
@@ -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 = {
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 08/56] fs/afs: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (6 preceding siblings ...)
  2014-11-13 21:22 ` [PATCH 07/56] fs/affs: " Pieter Smith
@ 2014-11-13 21:22 ` Pieter Smith
  2014-11-13 21:22 ` [PATCH 09/56] fs/bad_inode: " Pieter Smith
                   ` (47 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:22 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, David Howells, open list:AFS FILESYSTEM &...,
	open list

Compile out splice support from afs when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/afs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/afs/file.c b/fs/afs/file.c
index 932ce07..d7c7af5 100644
--- a/fs/afs/file.c
+++ b/fs/afs/file.c
@@ -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,
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 09/56] fs/bad_inode: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (7 preceding siblings ...)
  2014-11-13 21:22 ` [PATCH 08/56] fs/afs: " Pieter Smith
@ 2014-11-13 21:22 ` Pieter Smith
  2014-11-13 21:22 ` [PATCH 10/56] fs/block_dev: " Pieter Smith
                   ` (46 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:22 UTC (permalink / raw)
  To: pieter; +Cc: Josh Triplett, Alexander Viro, linux-fsdevel, open list

Compile 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

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/bad_inode.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/fs/bad_inode.c b/fs/bad_inode.c
index afd2b44..ccb076d 100644
--- a/fs/bad_inode.c
+++ b/fs/bad_inode.c
@@ -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,
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 10/56] fs/block_dev: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (8 preceding siblings ...)
  2014-11-13 21:22 ` [PATCH 09/56] fs/bad_inode: " Pieter Smith
@ 2014-11-13 21:22 ` Pieter Smith
  2014-11-13 21:22 ` [PATCH 11/56] fs/bfs: " Pieter Smith
                   ` (45 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:22 UTC (permalink / raw)
  To: pieter; +Cc: Josh Triplett, Alexander Viro, linux-fsdevel, open list

Compile 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).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/block_dev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/block_dev.c b/fs/block_dev.c
index 6d72746..ce7096b 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -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)
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 11/56] fs/bfs: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (9 preceding siblings ...)
  2014-11-13 21:22 ` [PATCH 10/56] fs/block_dev: " Pieter Smith
@ 2014-11-13 21:22 ` Pieter Smith
  2014-11-13 21:22 ` [PATCH 12/56] fs/btrfs: " Pieter Smith
                   ` (44 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:22 UTC (permalink / raw)
  To: pieter; +Cc: Josh Triplett, Tigran A. Aivazian, open list

Compile out splice support from bfs when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/bfs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/bfs/file.c b/fs/bfs/file.c
index e7f88ac..74ea687 100644
--- a/fs/bfs/file.c
+++ b/fs/bfs/file.c
@@ -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,
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 12/56] fs/btrfs: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (10 preceding siblings ...)
  2014-11-13 21:22 ` [PATCH 11/56] fs/bfs: " Pieter Smith
@ 2014-11-13 21:22 ` Pieter Smith
  2014-11-13 21:22 ` [PATCH 13/56] fs/ceph: " Pieter Smith
                   ` (43 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:22 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, Chris Mason, Josef Bacik,
	open list:BTRFS FILE SYSTEM, open list

Compile out splice support from btrfs when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/btrfs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index d3afac2..68c2f0a 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -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,
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 13/56] fs/ceph: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (11 preceding siblings ...)
  2014-11-13 21:22 ` [PATCH 12/56] fs/btrfs: " Pieter Smith
@ 2014-11-13 21:22 ` Pieter Smith
  2014-11-13 21:22 ` [PATCH 14/56] fs/cifs: " Pieter Smith
                   ` (42 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:22 UTC (permalink / raw)
  To: pieter; +Cc: Josh Triplett, Sage Weil, open list:CEPH DISTRIBUTED..., open list

Compile out splice support from ceph when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/ceph/file.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 2eb02f8..c85396a 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -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,
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 14/56] fs/cifs: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (12 preceding siblings ...)
  2014-11-13 21:22 ` [PATCH 13/56] fs/ceph: " Pieter Smith
@ 2014-11-13 21:22 ` Pieter Smith
  2014-11-13 21:22 ` [PATCH 15/56] fs/coda: " Pieter Smith
                   ` (41 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:22 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, Steve French, open list:COMMON INTERNET F...,
	moderated list:COMMON INTERNET F...,
	open list

Compile out splice support from cifs when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/cifs/cifsfs.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index ac4f260..b2bd0a0 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -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 */
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 15/56] fs/coda: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (13 preceding siblings ...)
  2014-11-13 21:22 ` [PATCH 14/56] fs/cifs: " Pieter Smith
@ 2014-11-13 21:22 ` Pieter Smith
  2014-11-13 21:22 ` [PATCH 16/56] fs/encryptfs: " Pieter Smith
                   ` (40 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:22 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, Jan Harkes, maintainer:CODA FILE SYSTEM,
	open list:CODA FILE SYSTEM, open list

Compile out splice support from coda when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/coda/file.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/coda/file.c b/fs/coda/file.c
index d244d74..a9d8c5d 100644
--- a/fs/coda/file.c
+++ b/fs/coda/file.c
@@ -42,6 +42,7 @@ coda_file_read(struct file *coda_file, char __user *buf, size_t count, loff_t *p
 	return 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)
 };
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 16/56] fs/encryptfs: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (14 preceding siblings ...)
  2014-11-13 21:22 ` [PATCH 15/56] fs/coda: " Pieter Smith
@ 2014-11-13 21:22 ` Pieter Smith
  2014-11-13 21:22 ` [PATCH 17/56] fs/exofs: " Pieter Smith
                   ` (39 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:22 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, Tyler Hicks, open list:ECRYPT FILE SYSTEM, open list

Compile out splice support from encryptfs when the splice-family of syscalls is
not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/ecryptfs/file.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c
index db0fad3..107a316 100644
--- a/fs/ecryptfs/file.c
+++ b/fs/ecryptfs/file.c
@@ -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)
 };
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 17/56] fs/exofs: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (15 preceding siblings ...)
  2014-11-13 21:22 ` [PATCH 16/56] fs/encryptfs: " Pieter Smith
@ 2014-11-13 21:22 ` Pieter Smith
  2014-11-16  9:02   ` [osd-dev] " Boaz Harrosh
  2014-11-13 21:22 ` [PATCH 18/56] fs/ext2: " Pieter Smith
                   ` (38 subsequent siblings)
  55 siblings, 1 reply; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:22 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, Boaz Harrosh, Benny Halevy,
	open list:OSD LIBRARY and F...,
	open list

Compile out splice support from exofs when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/exofs/file.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/exofs/file.c b/fs/exofs/file.c
index 71bf8e4..23dfb05 100644
--- a/fs/exofs/file.c
+++ b/fs/exofs/file.c
@@ -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 = {
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 18/56] fs/ext2: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (16 preceding siblings ...)
  2014-11-13 21:22 ` [PATCH 17/56] fs/exofs: " Pieter Smith
@ 2014-11-13 21:22 ` Pieter Smith
  2014-11-13 21:22 ` [PATCH 19/56] fs/ext3: " Pieter Smith
                   ` (37 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:22 UTC (permalink / raw)
  To: pieter; +Cc: Josh Triplett, Jan Kara, open list:EXT2 FILE SYSTEM, open list

Compile out splice support from ext2 when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/ext2/file.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ext2/file.c b/fs/ext2/file.c
index 7c87b22..8a40d04 100644
--- a/fs/ext2/file.c
+++ b/fs/ext2/file.c
@@ -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
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 19/56] fs/ext3: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (17 preceding siblings ...)
  2014-11-13 21:22 ` [PATCH 18/56] fs/ext2: " Pieter Smith
@ 2014-11-13 21:22 ` Pieter Smith
  2014-11-13 21:22 ` [PATCH 20/56] fs/ext4: " Pieter Smith
                   ` (36 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:22 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, Jan Kara, Andrew Morton, Andreas Dilger,
	open list:EXT3 FILE SYSTEM, open list

Compile out splice support from ext3 when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/ext3/file.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ext3/file.c b/fs/ext3/file.c
index a062fa1..e683870 100644
--- a/fs/ext3/file.c
+++ b/fs/ext3/file.c
@@ -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 = {
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 20/56] fs/ext4: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (18 preceding siblings ...)
  2014-11-13 21:22 ` [PATCH 19/56] fs/ext3: " Pieter Smith
@ 2014-11-13 21:22 ` Pieter Smith
  2014-11-14  0:28   ` josh
  2014-11-13 21:22 ` [PATCH 21/56] fs/f2fs: " Pieter Smith
                   ` (35 subsequent siblings)
  55 siblings, 1 reply; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:22 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, Theodore Ts'o, Andreas Dilger,
	open list:EXT4 FILE SYSTEM, open list

Compile out splice support from ext4 when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/ext4/file.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ext4/file.c b/fs/ext4/file.c
index aca7b24..c9d2962 100644
--- a/fs/ext4/file.c
+++ b/fs/ext4/file.c
@@ -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,
 };
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 21/56] fs/f2fs: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (19 preceding siblings ...)
  2014-11-13 21:22 ` [PATCH 20/56] fs/ext4: " Pieter Smith
@ 2014-11-13 21:22 ` Pieter Smith
  2014-11-13 21:22 ` [PATCH 22/56] fs/fat: " Pieter Smith
                   ` (34 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:22 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, Jaegeuk Kim, Changman Lee,
	open list:F2FS FILE SYSTEM, open list

Compile out splice support from f2fs when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/f2fs/file.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 208f1a9..57c6d40 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -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)
 };
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 22/56] fs/fat: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (20 preceding siblings ...)
  2014-11-13 21:22 ` [PATCH 21/56] fs/f2fs: " Pieter Smith
@ 2014-11-13 21:22 ` Pieter Smith
  2014-11-13 21:23 ` [PATCH 23/56] fs/fuse: " Pieter Smith
                   ` (33 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:22 UTC (permalink / raw)
  To: pieter; +Cc: Josh Triplett, OGAWA Hirofumi, open list

Compile out splice support from fat when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/fat/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/fat/file.c b/fs/fat/file.c
index 85f79a8..2067b5a 100644
--- a/fs/fat/file.c
+++ b/fs/fat/file.c
@@ -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)
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 23/56] fs/fuse: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (21 preceding siblings ...)
  2014-11-13 21:22 ` [PATCH 22/56] fs/fat: " Pieter Smith
@ 2014-11-13 21:23 ` Pieter Smith
  2014-11-13 21:23 ` [PATCH 24/56] fs/gfs2: " Pieter Smith
                   ` (32 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, Miklos Szeredi, open list:FUSE: FILESYSTEM..., open list

Compile out splice support from fuse when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/fuse/dev.c  | 8 ++++++--
 fs/fuse/file.c | 2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index ca88731..c082b72 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -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,
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 912061a..97f060a 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -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,
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 24/56] fs/gfs2: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (22 preceding siblings ...)
  2014-11-13 21:23 ` [PATCH 23/56] fs/fuse: " Pieter Smith
@ 2014-11-13 21:23 ` Pieter Smith
  2014-11-13 21:23 ` [PATCH 25/56] fs/hfs: " Pieter Smith
                   ` (31 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, Steven Whitehouse, open list:GFS2 FILE SYSTEM, open list

Compile out splice support from gfs2 when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/gfs2/file.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index 26b3f95..f7cb861 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -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,
 };
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 25/56] fs/hfs: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (23 preceding siblings ...)
  2014-11-13 21:23 ` [PATCH 24/56] fs/gfs2: " Pieter Smith
@ 2014-11-13 21:23 ` Pieter Smith
  2014-11-13 21:23 ` [PATCH 26/56] fs/hfsplus: " Pieter Smith
                   ` (30 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, Al Viro, Andrew Morton, Minchan Kim, Rik van Riel,
	Johannes Weiner, open list:HFS FILESYSTEM, open list

Compile out splice support from hfs when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/hfs/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c
index d0929bc..17c7963 100644
--- a/fs/hfs/inode.c
+++ b/fs/hfs/inode.c
@@ -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,
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 26/56] fs/hfsplus: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (24 preceding siblings ...)
  2014-11-13 21:23 ` [PATCH 25/56] fs/hfs: " Pieter Smith
@ 2014-11-13 21:23 ` Pieter Smith
  2014-11-13 21:23 ` [PATCH 27/56] fs/hostfs: " Pieter Smith
                   ` (29 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, Al Viro, Christoph Hellwig, Andrew Morton,
	Vyacheslav Dubeyko, Sergei Antonov, Sougata Santra,
	open list:HFSPLUS FILESYSTEM, open list

Compile out splice support from hfsplus when the splice-family of syscalls is
not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/hfsplus/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c
index 0cf786f..8dfd889 100644
--- a/fs/hfsplus/inode.c
+++ b/fs/hfsplus/inode.c
@@ -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,
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 27/56] fs/hostfs: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (25 preceding siblings ...)
  2014-11-13 21:23 ` [PATCH 26/56] fs/hfsplus: " Pieter Smith
@ 2014-11-13 21:23 ` Pieter Smith
  2014-11-13 21:23 ` [PATCH 28/56] fs/hpfs: " Pieter Smith
                   ` (28 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, Jeff Dike, Richard Weinberger,
	user-mode-linux-devel, open list

Compile out splice support from hostfs when the splice-family of syscalls is
not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/hostfs/hostfs_kern.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
index fd62cae..e750cc0 100644
--- a/fs/hostfs/hostfs_kern.c
+++ b/fs/hostfs/hostfs_kern.c
@@ -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,
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 28/56] fs/hpfs: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (26 preceding siblings ...)
  2014-11-13 21:23 ` [PATCH 27/56] fs/hostfs: " Pieter Smith
@ 2014-11-13 21:23 ` Pieter Smith
  2014-11-13 21:23 ` [PATCH 29/56] fs/jffs2: " Pieter Smith
                   ` (27 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter; +Cc: Josh Triplett, Mikulas Patocka, open list

Compile out splice support from hpfs when the splice-family of syscalls is
not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/hpfs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/hpfs/file.c b/fs/hpfs/file.c
index 7f54e5f..51a6d74 100644
--- a/fs/hpfs/file.c
+++ b/fs/hpfs/file.c
@@ -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 =
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 29/56] fs/jffs2: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (27 preceding siblings ...)
  2014-11-13 21:23 ` [PATCH 28/56] fs/hpfs: " Pieter Smith
@ 2014-11-13 21:23 ` Pieter Smith
  2014-11-13 21:23 ` [PATCH 30/56] fs/jfs: " Pieter Smith
                   ` (26 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, David Woodhouse, open list:JOURNALLING FLASH...,
	open list

Compile out splice support from jffs2 when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/jffs2/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/jffs2/file.c b/fs/jffs2/file.c
index 64989ca..bb4e88b 100644
--- a/fs/jffs2/file.c
+++ b/fs/jffs2/file.c
@@ -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 */
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 30/56] fs/jfs: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (28 preceding siblings ...)
  2014-11-13 21:23 ` [PATCH 29/56] fs/jffs2: " Pieter Smith
@ 2014-11-13 21:23 ` Pieter Smith
  2014-11-13 21:23 ` [PATCH 31/56] fs/minix: " Pieter Smith
                   ` (25 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter; +Cc: Josh Triplett, Dave Kleikamp, open list:JFS FILESYSTEM, open list

Compile out splice support from jfs when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/jfs/file.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/jfs/file.c b/fs/jfs/file.c
index 33aa0cc..88df840 100644
--- a/fs/jfs/file.c
+++ b/fs/jfs/file.c
@@ -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,
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 31/56] fs/minix: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (29 preceding siblings ...)
  2014-11-13 21:23 ` [PATCH 30/56] fs/jfs: " Pieter Smith
@ 2014-11-13 21:23 ` Pieter Smith
  2014-11-13 21:23 ` [PATCH 32/56] fs/nfs: " Pieter Smith
                   ` (24 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter; +Cc: Josh Triplett, Al Viro, open list

Compile out splice support from minix when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/minix/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/minix/file.c b/fs/minix/file.c
index a967de0..4e55d35 100644
--- a/fs/minix/file.c
+++ b/fs/minix/file.c
@@ -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)
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 32/56] fs/nfs: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (30 preceding siblings ...)
  2014-11-13 21:23 ` [PATCH 31/56] fs/minix: " Pieter Smith
@ 2014-11-13 21:23 ` Pieter Smith
  2014-11-13 21:23 ` [PATCH 33/56] fs/nfsd: " Pieter Smith
                   ` (23 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, Trond Myklebust, open list:NFS, SUNRPC, AND..., open list

Compile out splice support from nfs when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/nfs/file.c     | 6 ++++--
 fs/nfs/nfs4file.c | 4 ++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 524dd80..b36b4fb 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -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,
 };
diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c
index a816f06..81dd4c8 100644
--- a/fs/nfs/nfs4file.c
+++ b/fs/nfs/nfs4file.c
@@ -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,
 };
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 33/56] fs/nfsd: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (31 preceding siblings ...)
  2014-11-13 21:23 ` [PATCH 32/56] fs/nfs: " Pieter Smith
@ 2014-11-13 21:23 ` Pieter Smith
  2014-11-13 21:23 ` [PATCH 34/56] fs/nilfs2: " Pieter Smith
                   ` (22 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, J. Bruce Fields, open list:KERNEL NFSD, SUNR...,
	open list

Compile out splice support from nfsd when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/nfsd/nfs4xdr.c | 4 ++++
 fs/nfsd/vfs.c     | 6 ++++++
 2 files changed, 10 insertions(+)

diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index f9821ce..c4ee0fd 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -3060,6 +3060,7 @@ nfsd4_encode_open_downgrade(struct nfsd4_compoundres *resp, __be32 nfserr, struc
 	return 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)
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index f501a9b..036db70 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -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);
 }
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 34/56] fs/nilfs2: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (32 preceding siblings ...)
  2014-11-13 21:23 ` [PATCH 33/56] fs/nfsd: " Pieter Smith
@ 2014-11-13 21:23 ` Pieter Smith
  2014-11-13 21:23 ` [PATCH 35/56] fs/ntfs: " Pieter Smith
                   ` (21 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, Ryusuke Konishi, open list:NILFS2 FILESYSTEM, open list

Compile out splice support from nilfs2 when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/nilfs2/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nilfs2/file.c b/fs/nilfs2/file.c
index 2497815..dc63aea 100644
--- a/fs/nilfs2/file.c
+++ b/fs/nilfs2/file.c
@@ -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 = {
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 35/56] fs/ntfs: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (33 preceding siblings ...)
  2014-11-13 21:23 ` [PATCH 34/56] fs/nilfs2: " Pieter Smith
@ 2014-11-13 21:23 ` Pieter Smith
  2014-11-13 21:23 ` [PATCH 36/56] fs/ocfs2: " Pieter Smith
                   ` (20 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, Anton Altaparmakov, open list:NTFS FILESYSTEM, open list

Compile out splice support from ntfs when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/ntfs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c
index f5ec1ce..cc5def2 100644
--- a/fs/ntfs/file.c
+++ b/fs/ntfs/file.c
@@ -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
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 36/56] fs/ocfs2: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (34 preceding siblings ...)
  2014-11-13 21:23 ` [PATCH 35/56] fs/ntfs: " Pieter Smith
@ 2014-11-13 21:23 ` Pieter Smith
  2014-11-13 21:23 ` [PATCH 37/56] fs/omfs: " Pieter Smith
                   ` (19 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, Mark Fasheh, Joel Becker,
	moderated list:ORACLE CLUSTER FI...,
	open list

Compile out splice support from ocfs2 when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/ocfs2/file.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 2930e23..44b9605 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -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,
 };
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 37/56] fs/omfs: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (35 preceding siblings ...)
  2014-11-13 21:23 ` [PATCH 36/56] fs/ocfs2: " Pieter Smith
@ 2014-11-13 21:23 ` Pieter Smith
  2014-11-13 21:23 ` [PATCH 38/56] fs/ramfs: " Pieter Smith
                   ` (18 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter; +Cc: Josh Triplett, Bob Copeland, open list:OMFS FILESYSTEM, open list

Compile out splice support from omfs when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/omfs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/omfs/file.c b/fs/omfs/file.c
index 902e885..02e8d08 100644
--- a/fs/omfs/file.c
+++ b/fs/omfs/file.c
@@ -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)
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 38/56] fs/ramfs: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (36 preceding siblings ...)
  2014-11-13 21:23 ` [PATCH 37/56] fs/omfs: " Pieter Smith
@ 2014-11-13 21:23 ` Pieter Smith
  2014-11-13 21:23 ` [PATCH 39/56] fs/reiserfs: " Pieter Smith
                   ` (17 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, Al Viro, Axel Lin, Andrew Morton,
	Fabian Frederick, open list

Compile out splice support from ramfs when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/ramfs/file-mmu.c   | 4 ++--
 fs/ramfs/file-nommu.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/ramfs/file-mmu.c b/fs/ramfs/file-mmu.c
index 4f56de8..6a80e59 100644
--- a/fs/ramfs/file-mmu.c
+++ b/fs/ramfs/file-mmu.c
@@ -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,
 };
 
diff --git a/fs/ramfs/file-nommu.c b/fs/ramfs/file-nommu.c
index bbafbde..b457303 100644
--- a/fs/ramfs/file-nommu.c
+++ b/fs/ramfs/file-nommu.c
@@ -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,
 };
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 39/56] fs/reiserfs: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (37 preceding siblings ...)
  2014-11-13 21:23 ` [PATCH 38/56] fs/ramfs: " Pieter Smith
@ 2014-11-13 21:23 ` Pieter Smith
  2014-11-13 21:23 ` [PATCH 40/56] fs/romfs: " Pieter Smith
                   ` (16 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, Jan Kara, Jeff Mahoney, Al Viro,
	Christoph Hellwig, Fabian Frederick,
	open list:REISERFS FILE SYSTEM, open list

Compile out splice support from reiserfs when the splice-family of syscalls is
not supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/reiserfs/file.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/reiserfs/file.c b/fs/reiserfs/file.c
index 751dd3f..b716c59 100644
--- a/fs/reiserfs/file.c
+++ b/fs/reiserfs/file.c
@@ -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,
 };
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 40/56] fs/romfs: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (38 preceding siblings ...)
  2014-11-13 21:23 ` [PATCH 39/56] fs/reiserfs: " Pieter Smith
@ 2014-11-13 21:23 ` Pieter Smith
  2014-11-13 21:23 ` [PATCH 41/56] fs/sysv: " Pieter Smith
                   ` (15 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter; +Cc: Josh Triplett, Al Viro, open list

Compile out splice support from romfs when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/romfs/mmap-nommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/romfs/mmap-nommu.c b/fs/romfs/mmap-nommu.c
index ea06c75..45a3f30 100644
--- a/fs/romfs/mmap-nommu.c
+++ b/fs/romfs/mmap-nommu.c
@@ -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,
 };
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 41/56] fs/sysv: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (39 preceding siblings ...)
  2014-11-13 21:23 ` [PATCH 40/56] fs/romfs: " Pieter Smith
@ 2014-11-13 21:23 ` Pieter Smith
  2014-11-13 21:23 ` [PATCH 42/56] fs/ubifs: " Pieter Smith
                   ` (14 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter; +Cc: Josh Triplett, Christoph Hellwig, open list

Compile out splice support from sysv when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/sysv/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/sysv/file.c b/fs/sysv/file.c
index b00811c..456194b 100644
--- a/fs/sysv/file.c
+++ b/fs/sysv/file.c
@@ -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)
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 42/56] fs/ubifs: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (40 preceding siblings ...)
  2014-11-13 21:23 ` [PATCH 41/56] fs/sysv: " Pieter Smith
@ 2014-11-13 21:23 ` Pieter Smith
  2014-11-13 21:23 ` [PATCH 43/56] fs/udf: " Pieter Smith
                   ` (13 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, Artem Bityutskiy, Adrian Hunter, linux-mtd, open list

Compile out splice support from ubifs when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/ubifs/file.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c
index b5b593c..76112a9 100644
--- a/fs/ubifs/file.c
+++ b/fs/ubifs/file.c
@@ -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
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 43/56] fs/udf: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (41 preceding siblings ...)
  2014-11-13 21:23 ` [PATCH 42/56] fs/ubifs: " Pieter Smith
@ 2014-11-13 21:23 ` Pieter Smith
  2014-11-13 21:23 ` [PATCH 44/56] fs/ufs: " Pieter Smith
                   ` (12 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter; +Cc: Josh Triplett, Jan Kara, open list

Compile out splice support from udf when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/udf/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/udf/file.c b/fs/udf/file.c
index 86c6743..65e5335 100644
--- a/fs/udf/file.c
+++ b/fs/udf/file.c
@@ -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,
 };
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 44/56] fs/ufs: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (42 preceding siblings ...)
  2014-11-13 21:23 ` [PATCH 43/56] fs/udf: " Pieter Smith
@ 2014-11-13 21:23 ` Pieter Smith
  2014-11-13 21:23 ` [PATCH 45/56] fs/xfs: " Pieter Smith
                   ` (11 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter; +Cc: Josh Triplett, Evgeniy Dushistov, open list

Compile out splice support from ufs when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/ufs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ufs/file.c b/fs/ufs/file.c
index c84ec01..247308d 100644
--- a/fs/ufs/file.c
+++ b/fs/ufs/file.c
@@ -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)
 };
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 45/56] fs/xfs: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (43 preceding siblings ...)
  2014-11-13 21:23 ` [PATCH 44/56] fs/ufs: " Pieter Smith
@ 2014-11-13 21:23 ` Pieter Smith
  2014-11-13 21:23 ` [PATCH 46/56] kernel/relay: " Pieter Smith
                   ` (10 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter; +Cc: Josh Triplett, Dave Chinner, supporter:XFS FILESYSTEM, open list

Compile out splice support from xfs when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/xfs/xfs_file.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index 076b170..0357dfc 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -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,
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 46/56] kernel/relay: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (44 preceding siblings ...)
  2014-11-13 21:23 ` [PATCH 45/56] fs/xfs: " Pieter Smith
@ 2014-11-13 21:23 ` Pieter Smith
  2014-11-13 21:23 ` [PATCH 47/56] kenel/trace: " Pieter Smith
                   ` (9 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, Al Viro, Jiri Kosina, Masanari Iida, Randy Dunlap,
	open list

Compile out splice support from relay when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 kernel/relay.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/kernel/relay.c b/kernel/relay.c
index 5a56d3c..fed90ca 100644
--- a/kernel/relay.c
+++ b/kernel/relay.c
@@ -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);
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 47/56] kenel/trace: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (45 preceding siblings ...)
  2014-11-13 21:23 ` [PATCH 46/56] kernel/relay: " Pieter Smith
@ 2014-11-13 21:23 ` Pieter Smith
  2014-11-17 20:33   ` Steven Rostedt
  2014-11-13 21:23 ` [PATCH 48/56] mm/shmem: " Pieter Smith
                   ` (8 subsequent siblings)
  55 siblings, 1 reply; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter; +Cc: Josh Triplett, Steven Rostedt, Ingo Molnar, open list

Compile out splice support from trace when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 kernel/trace/trace.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 8a52839..e672979 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -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,
 };
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 48/56] mm/shmem: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (46 preceding siblings ...)
  2014-11-13 21:23 ` [PATCH 47/56] kenel/trace: " Pieter Smith
@ 2014-11-13 21:23 ` Pieter Smith
  2014-11-13 21:23 ` [PATCH 49/56] net/socket: " Pieter Smith
                   ` (7 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter; +Cc: Josh Triplett, Hugh Dickins, linux-mm, open list

Compile out splice support from shmem when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 mm/shmem.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/mm/shmem.c b/mm/shmem.c
index 0e5fb22..4fb78b3 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -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
 };
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 49/56] net/socket: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (47 preceding siblings ...)
  2014-11-13 21:23 ` [PATCH 48/56] mm/shmem: " Pieter Smith
@ 2014-11-13 21:23 ` Pieter Smith
  2014-11-13 21:23 ` [PATCH 50/56] fs/read_write: " Pieter Smith
                   ` (6 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, David S. Miller, open list:NETWORKING [GENERAL],
	open list

Compile out splice support from socket when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 net/socket.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/net/socket.c b/net/socket.c
index 95ee7d8..5cb347a 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -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)
 {
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 50/56] fs/read_write: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (48 preceding siblings ...)
  2014-11-13 21:23 ` [PATCH 49/56] net/socket: " Pieter Smith
@ 2014-11-13 21:23 ` Pieter Smith
  2014-11-13 21:23 ` [PATCH 51/56] drivers/char/mem: " Pieter Smith
                   ` (5 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter; +Cc: Josh Triplett, Alexander Viro, linux-fsdevel, open list

Compile 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).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 fs/read_write.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/read_write.c b/fs/read_write.c
index 4361261..55dee62 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -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);
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 51/56] drivers/char/mem: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (49 preceding siblings ...)
  2014-11-13 21:23 ` [PATCH 50/56] fs/read_write: " Pieter Smith
@ 2014-11-13 21:23 ` Pieter Smith
  2014-11-13 22:09   ` Greg Kroah-Hartman
  2014-11-13 21:23 ` [PATCH 52/56] drivers/char/virtio: " Pieter Smith
                   ` (4 subsequent siblings)
  55 siblings, 1 reply; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter; +Cc: Josh Triplett, Arnd Bergmann, Greg Kroah-Hartman, open list

Compile 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   delta
pipe_to_null                                   4       -      -4
splice_write_null                             24       -     -24

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 drivers/char/mem.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 917403f..420d651 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -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
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 52/56] drivers/char/virtio: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (50 preceding siblings ...)
  2014-11-13 21:23 ` [PATCH 51/56] drivers/char/mem: " Pieter Smith
@ 2014-11-13 21:23 ` Pieter Smith
  2014-11-13 22:09   ` Greg Kroah-Hartman
  2014-11-13 21:23 ` [PATCH 53/56] net/ipv6: " Pieter Smith
                   ` (3 subsequent siblings)
  55 siblings, 1 reply; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, Arnd Bergmann, Greg Kroah-Hartman, Amit Shah,
	open list:VIRTIO CONSOLE DR...,
	open list

Compile 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).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 drivers/char/virtio_console.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index b585b47..de5e2cb 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -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,
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 53/56] net/ipv6: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (51 preceding siblings ...)
  2014-11-13 21:23 ` [PATCH 52/56] drivers/char/virtio: " Pieter Smith
@ 2014-11-13 21:23 ` Pieter Smith
  2014-11-13 21:23 ` [PATCH 54/56] net/ipv4: " Pieter Smith
                   ` (2 subsequent siblings)
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, David S. Miller, Alexey Kuznetsov, James Morris,
	Hideaki YOSHIFUJI, Patrick McHardy,
	open list:NETWORKING [IPv4/...,
	open list

Compile 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).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 net/ipv6/af_inet6.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index 2daa3a1..3d17064 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -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,
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 54/56] net/ipv4: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (52 preceding siblings ...)
  2014-11-13 21:23 ` [PATCH 53/56] net/ipv6: " Pieter Smith
@ 2014-11-13 21:23 ` Pieter Smith
  2014-11-13 21:23 ` [PATCH 55/56] net/core: " Pieter Smith
  2014-11-13 21:23 ` [PATCH 56/56] fs/splice: full support for " Pieter Smith
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, David S. Miller, Alexey Kuznetsov, James Morris,
	Hideaki YOSHIFUJI, Patrick McHardy,
	open list:NETWORKING [IPv4/...,
	open list

Compile 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).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 net/ipv4/af_inet.c | 2 +-
 net/ipv4/tcp.c     | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index d156b3c..e025478 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -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,
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 541f26a..afc825f 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -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)
 {
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 55/56] net/core: support compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (53 preceding siblings ...)
  2014-11-13 21:23 ` [PATCH 54/56] net/ipv4: " Pieter Smith
@ 2014-11-13 21:23 ` Pieter Smith
  2014-11-13 21:23 ` [PATCH 56/56] fs/splice: full support for " Pieter Smith
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, David S. Miller, Tom Herbert, Willem de Bruijn,
	Eric Dumazet, Daniel Borkmann, Florian Westphal,
	Michael S. Tsirkin, Vlad Yasevich, Paul Durrant, Thomas Graf,
	Herbert Xu, Jan Beulich, Miklos Szeredi, open list,
	open list:NETWORKING [GENERAL]

Compile 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).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 include/linux/skbuff.h | 2 ++
 net/core/skbuff.c      | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index abde271..5a67427 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -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,
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 163b673..5610904 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -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
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* [PATCH 56/56] fs/splice: full support for compiling out splice
       [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
                   ` (54 preceding siblings ...)
  2014-11-13 21:23 ` [PATCH 55/56] net/core: " Pieter Smith
@ 2014-11-13 21:23 ` Pieter Smith
  55 siblings, 0 replies; 72+ messages in thread
From: Pieter Smith @ 2014-11-13 21:23 UTC (permalink / raw)
  To: pieter
  Cc: Josh Triplett, Alexander Viro, Jeff Layton, J. Bruce Fields,
	Andrew Morton, Konrad Rzeszutek Wilk, Minchan Kim,
	Fabian Frederick, Randy Dunlap, Xiao Guangrong, open list,
	linux-fsdevel

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/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

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
 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(-)

diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
index 014a1cf..804125ea 100644
--- a/drivers/block/Kconfig
+++ b/drivers/block/Kconfig
@@ -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
diff --git a/fs/Makefile b/fs/Makefile
index 90c8852..13f9cfa 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)
@@ -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
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 a88de9f..5d6b759 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -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);
diff --git a/include/linux/splice.h b/include/linux/splice.h
index da2751d..ecd176f 100644
--- a/include/linux/splice.h
+++ b/include/linux/splice.h
@@ -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
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 72+ messages in thread

* Re: [PATCH 04/56] fs: Macros to define splice file_operations
  2014-11-13 21:22 ` [PATCH 04/56] fs: Macros to define splice file_operations Pieter Smith
@ 2014-11-13 21:49   ` Richard Weinberger
  2014-11-13 22:24     ` josh
  2014-11-13 21:51   ` Al Viro
  1 sibling, 1 reply; 72+ messages in thread
From: Richard Weinberger @ 2014-11-13 21:49 UTC (permalink / raw)
  To: Pieter Smith
  Cc: Josh Triplett, Jeff Layton, J. Bruce Fields, linux-fsdevel, open list

On Thu, Nov 13, 2014 at 10:22 PM, Pieter Smith <pieter@boesman.nl> wrote:
> Provides 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
>
> Signed-off-by: Pieter Smith <pieter@boesman.nl>
> ---
>  include/linux/fs.h | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
>
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 9418772..a88de9f 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -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,

This is ugly like hell.
Why can't you do something like __exit_p()?

-- 
Thanks,
//richard

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH 04/56] fs: Macros to define splice file_operations
  2014-11-13 21:22 ` [PATCH 04/56] fs: Macros to define splice file_operations Pieter Smith
  2014-11-13 21:49   ` Richard Weinberger
@ 2014-11-13 21:51   ` Al Viro
  1 sibling, 0 replies; 72+ messages in thread
From: Al Viro @ 2014-11-13 21:51 UTC (permalink / raw)
  To: Pieter Smith
  Cc: Josh Triplett, Jeff Layton, J. Bruce Fields, linux-fsdevel, open list

On Thu, Nov 13, 2014 at 10:22:41PM +0100, Pieter Smith wrote:
> Provides 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

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.

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH 51/56] drivers/char/mem: support compiling out splice
  2014-11-13 21:23 ` [PATCH 51/56] drivers/char/mem: " Pieter Smith
@ 2014-11-13 22:09   ` Greg Kroah-Hartman
       [not found]     ` <CAPho-_JJGy0cwBVfWKL1Gt9ZQZM+Odo7W05bKQ2JLO+TM-ABJA@mail.gmail.com>
  0 siblings, 1 reply; 72+ messages in thread
From: Greg Kroah-Hartman @ 2014-11-13 22:09 UTC (permalink / raw)
  To: Pieter Smith; +Cc: Josh Triplett, Arnd Bergmann, open list

On Thu, Nov 13, 2014 at 10:23:28PM +0100, Pieter Smith wrote:
> Compile 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   delta
> pipe_to_null                                   4       -      -4
> splice_write_null                             24       -     -24
> 
> Signed-off-by: Pieter Smith <pieter@boesman.nl>
> ---
>  drivers/char/mem.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/char/mem.c b/drivers/char/mem.c
> index 917403f..420d651 100644
> --- a/drivers/char/mem.c
> +++ b/drivers/char/mem.c
> @@ -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 */
>  

Ick, no, not worth the #ifdef mess, sorry.


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH 05/56] fs/lustre: support compiling out splice
  2014-11-13 21:22 ` [PATCH 05/56] fs/lustre: support compiling out splice Pieter Smith
@ 2014-11-13 22:09   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 72+ messages in thread
From: Greg Kroah-Hartman @ 2014-11-13 22:09 UTC (permalink / raw)
  To: Pieter Smith
  Cc: open list:STAGING SUBSYSTEM, Dmitry Eremin, Li Xi,
	Andreas Dilger, Peng Tao, Josh Triplett, Oleg Drokin,
	Andrew Perepechko, JC Lafoucriere, Jinshan Xiong,
	John L. Hammond, Lai Siyao, open list, Al Viro

On Thu, Nov 13, 2014 at 10:22:42PM +0100, Pieter Smith wrote:
> Compile 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).
> 
> Signed-off-by: Pieter Smith <pieter@boesman.nl>
> ---
>  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(-)
> 
> diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c
> index fd1b75a3..98573da 100644
> --- a/drivers/staging/lustre/lustre/llite/file.c
> +++ b/drivers/staging/lustre/lustre/llite/file.c
> @@ -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.


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH 52/56] drivers/char/virtio: support compiling out splice
  2014-11-13 21:23 ` [PATCH 52/56] drivers/char/virtio: " Pieter Smith
@ 2014-11-13 22:09   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 72+ messages in thread
From: Greg Kroah-Hartman @ 2014-11-13 22:09 UTC (permalink / raw)
  To: Pieter Smith
  Cc: Josh Triplett, Arnd Bergmann, Amit Shah,
	open list:VIRTIO CONSOLE DR...,
	open list

On Thu, Nov 13, 2014 at 10:23:29PM +0100, Pieter Smith wrote:
> Compile 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).
> 
> Signed-off-by: Pieter Smith <pieter@boesman.nl>
> ---
>  drivers/char/virtio_console.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
> index b585b47..de5e2cb 100644
> --- a/drivers/char/virtio_console.c
> +++ b/drivers/char/virtio_console.c
> @@ -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 */

Not worth the #ifdef mess.

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH 04/56] fs: Macros to define splice file_operations
  2014-11-13 21:49   ` Richard Weinberger
@ 2014-11-13 22:24     ` josh
  0 siblings, 0 replies; 72+ messages in thread
From: josh @ 2014-11-13 22:24 UTC (permalink / raw)
  To: Richard Weinberger, Al Viro
  Cc: Pieter Smith, Jeff Layton, J. Bruce Fields, linux-fsdevel, open list

On Thu, Nov 13, 2014 at 10:49:07PM +0100, Richard Weinberger wrote:
> On Thu, Nov 13, 2014 at 10:22 PM, Pieter Smith <pieter@boesman.nl> wrote:
> > Provides 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
[...]
> > --- a/include/linux/fs.h
> > +++ b/include/linux/fs.h
> > @@ -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,
> 
> This is ugly like hell.
> Why can't you do something like __exit_p()?

On Thu, Nov 13, 2014 at 09:51:39PM +0000, Al Viro wrote:
> 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.

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

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH 51/56] drivers/char/mem: support compiling out splice
       [not found]     ` <CAPho-_JJGy0cwBVfWKL1Gt9ZQZM+Odo7W05bKQ2JLO+TM-ABJA@mail.gmail.com>
@ 2014-11-13 22:31       ` josh
  2014-11-13 23:34         ` Greg Kroah-Hartman
  0 siblings, 1 reply; 72+ messages in thread
From: josh @ 2014-11-13 22:31 UTC (permalink / raw)
  To: Pieter Smith; +Cc: Greg Kroah-Hartman, Arnd Bergmann, open list

[Please don't top-post.]

On Thu, Nov 13, 2014 at 11:23:46PM +0100, Pieter Smith wrote:
> 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

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH 51/56] drivers/char/mem: support compiling out splice
  2014-11-13 22:31       ` josh
@ 2014-11-13 23:34         ` Greg Kroah-Hartman
  2014-11-14  0:19           ` josh
  0 siblings, 1 reply; 72+ messages in thread
From: Greg Kroah-Hartman @ 2014-11-13 23:34 UTC (permalink / raw)
  To: josh; +Cc: Pieter Smith, Arnd Bergmann, open list

On Thu, Nov 13, 2014 at 02:31:50PM -0800, josh@joshtriplett.org wrote:
> [Please don't top-post.]
> 
> On Thu, Nov 13, 2014 at 11:23:46PM +0100, Pieter Smith wrote:
> > 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.

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

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH 51/56] drivers/char/mem: support compiling out splice
  2014-11-13 23:34         ` Greg Kroah-Hartman
@ 2014-11-14  0:19           ` josh
  2014-11-14  3:27             ` Greg Kroah-Hartman
  0 siblings, 1 reply; 72+ messages in thread
From: josh @ 2014-11-14  0:19 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Pieter Smith, Arnd Bergmann, open list

On Thu, Nov 13, 2014 at 03:34:16PM -0800, Greg Kroah-Hartman wrote:
> On Thu, Nov 13, 2014 at 02:31:50PM -0800, josh@joshtriplett.org wrote:
> > [Please don't top-post.]
> > 
> > On Thu, Nov 13, 2014 at 11:23:46PM +0100, Pieter Smith wrote:
> > > 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.
> 
> 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

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH 20/56] fs/ext4: support compiling out splice
  2014-11-13 21:22 ` [PATCH 20/56] fs/ext4: " Pieter Smith
@ 2014-11-14  0:28   ` josh
  0 siblings, 0 replies; 72+ messages in thread
From: josh @ 2014-11-14  0:28 UTC (permalink / raw)
  To: Pieter Smith
  Cc: Theodore Ts'o, Andreas Dilger, open list:EXT4 FILE SYSTEM, open list

On Thu, Nov 13, 2014 at 10:22:57PM +0100, Pieter Smith wrote:
> Compile out splice support from ext4 when the splice-family of syscalls is not
> supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
> 
> Signed-off-by: Pieter Smith <pieter@boesman.nl>

See below; you shouldn't need this or similar patches for most
filesystems at all.

>  fs/ext4/file.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/ext4/file.c b/fs/ext4/file.c
> index aca7b24..c9d2962 100644
> --- a/fs/ext4/file.c
> +++ b/fs/ext4/file.c
> @@ -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

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH 51/56] drivers/char/mem: support compiling out splice
  2014-11-14  0:19           ` josh
@ 2014-11-14  3:27             ` Greg Kroah-Hartman
       [not found]               ` <CAPho-_KUc-+c=X6xtLTD2F-o4qi+YpYdnw6F1cx4kniezfs7aw@mail.gmail.com>
  0 siblings, 1 reply; 72+ messages in thread
From: Greg Kroah-Hartman @ 2014-11-14  3:27 UTC (permalink / raw)
  To: josh; +Cc: Pieter Smith, Arnd Bergmann, open list

On Thu, Nov 13, 2014 at 04:19:48PM -0800, josh@joshtriplett.org wrote:
> On Thu, Nov 13, 2014 at 03:34:16PM -0800, Greg Kroah-Hartman wrote:
> > On Thu, Nov 13, 2014 at 02:31:50PM -0800, josh@joshtriplett.org wrote:
> > > [Please don't top-post.]
> > > 
> > > On Thu, Nov 13, 2014 at 11:23:46PM +0100, Pieter Smith wrote:
> > > > 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.
> > 
> > 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?

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?

> 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

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH 51/56] drivers/char/mem: support compiling out splice
       [not found]               ` <CAPho-_KUc-+c=X6xtLTD2F-o4qi+YpYdnw6F1cx4kniezfs7aw@mail.gmail.com>
@ 2014-11-14 23:25                 ` josh
       [not found]                 ` <CAPho-_LCj7bxJ2EvuZtBZXD1buH1V+nKEiobTJUATYmGYVRWcA@mail.gmail.com>
       [not found]                 ` <CAPho-_+ZXHYGB9-d19NR9u5tcOpN1Ytg80NZgvScF=YQ-6SdNA@mail.gmail.com>
  2 siblings, 0 replies; 72+ messages in thread
From: josh @ 2014-11-14 23:25 UTC (permalink / raw)
  To: Pieter Smith; +Cc: Greg Kroah-Hartman, open list, Arnd Bergmann

[Please don't top-post.]

On Sat, Nov 15, 2014 at 12:11:23AM +0100, Pieter Smith wrote:
> 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

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [osd-dev] [PATCH 17/56] fs/exofs: support compiling out splice
  2014-11-13 21:22 ` [PATCH 17/56] fs/exofs: " Pieter Smith
@ 2014-11-16  9:02   ` Boaz Harrosh
  0 siblings, 0 replies; 72+ messages in thread
From: Boaz Harrosh @ 2014-11-16  9:02 UTC (permalink / raw)
  To: Pieter Smith
  Cc: Benny Halevy, open list:OSD LIBRARY and F..., Josh Triplett, open list

On 11/13/2014 11:22 PM, Pieter Smith wrote:
> Compile out splice support from exofs when the splice-family of syscalls is not
> supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).
> 
> Signed-off-by: Pieter Smith <pieter@boesman.nl>

ACK-by: Boaz Harrosh <ooo@electrozaur.com>

Or do you need that I push it through my tree ?
> ---
>  fs/exofs/file.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/exofs/file.c b/fs/exofs/file.c
> index 71bf8e4..23dfb05 100644
> --- a/fs/exofs/file.c
> +++ b/fs/exofs/file.c
> @@ -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 = {
> 


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH 51/56] drivers/char/mem: support compiling out splice
       [not found]                 ` <CAPho-_LCj7bxJ2EvuZtBZXD1buH1V+nKEiobTJUATYmGYVRWcA@mail.gmail.com>
@ 2014-11-16 18:20                   ` Josh Triplett
  0 siblings, 0 replies; 72+ messages in thread
From: Josh Triplett @ 2014-11-16 18:20 UTC (permalink / raw)
  To: Pieter Smith; +Cc: Greg Kroah-Hartman, open list, Arnd Bergmann

[Please don't top-post.]

On Sun, Nov 16, 2014 at 01:18:27PM +0100, Pieter Smith wrote:
> I had a look at the numbers (see below): For a tinyconfig kernel, savings
> outside fs/splice.c are 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*
> 
> Given a tinyconfig, fs/splice.c can free up 8.2K (3.5K + 4.7K) with
> CONFIG_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

^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH 47/56] kenel/trace: support compiling out splice
  2014-11-13 21:23 ` [PATCH 47/56] kenel/trace: " Pieter Smith
@ 2014-11-17 20:33   ` Steven Rostedt
  0 siblings, 0 replies; 72+ messages in thread
From: Steven Rostedt @ 2014-11-17 20:33 UTC (permalink / raw)
  To: Pieter Smith; +Cc: Josh Triplett, Ingo Molnar, open list

On Thu, 13 Nov 2014 22:23:24 +0100
Pieter Smith <pieter@boesman.nl> wrote:

> Compile out splice support from trace when the splice-family of syscalls is not
> supported by the system (i.e. CONFIG_SYSCALL_SPLICE is 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


^ permalink raw reply	[flat|nested] 72+ messages in thread

* Re: [PATCH 51/56] drivers/char/mem: support compiling out splice
       [not found]                 ` <CAPho-_+ZXHYGB9-d19NR9u5tcOpN1Ytg80NZgvScF=YQ-6SdNA@mail.gmail.com>
@ 2014-11-18 22:42                   ` josh
  0 siblings, 0 replies; 72+ messages in thread
From: josh @ 2014-11-18 22:42 UTC (permalink / raw)
  To: Pieter Smith; +Cc: Greg Kroah-Hartman, open list, Arnd Bergmann

On Tue, Nov 18, 2014 at 10:46:59PM +0100, Pieter Smith wrote:
> Turning all exported splice functions into static inline NOP's covers
> almost everything...
> fs/fuse and net/skbuf use an exported ops struct from fs/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

^ permalink raw reply	[flat|nested] 72+ messages in thread

end of thread, other threads:[~2014-11-18 22:42 UTC | newest]

Thread overview: 72+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
2014-11-13 21:22 ` [PATCH 01/56] moved sendfile syscall to splice translation unit Pieter Smith
2014-11-13 21:22 ` [PATCH 02/56] moved kernel_write out of " Pieter Smith
2014-11-13 21:22 ` [PATCH 03/56] fs: Support compiling out splice-family syscalls Pieter Smith
2014-11-13 21:22 ` [PATCH 04/56] fs: Macros to define splice file_operations Pieter Smith
2014-11-13 21:49   ` Richard Weinberger
2014-11-13 22:24     ` josh
2014-11-13 21:51   ` Al Viro
2014-11-13 21:22 ` [PATCH 05/56] fs/lustre: support compiling out splice Pieter Smith
2014-11-13 22:09   ` Greg Kroah-Hartman
2014-11-13 21:22 ` [PATCH 06/56] fs/adfs: " Pieter Smith
2014-11-13 21:22 ` [PATCH 07/56] fs/affs: " Pieter Smith
2014-11-13 21:22 ` [PATCH 08/56] fs/afs: " Pieter Smith
2014-11-13 21:22 ` [PATCH 09/56] fs/bad_inode: " Pieter Smith
2014-11-13 21:22 ` [PATCH 10/56] fs/block_dev: " Pieter Smith
2014-11-13 21:22 ` [PATCH 11/56] fs/bfs: " Pieter Smith
2014-11-13 21:22 ` [PATCH 12/56] fs/btrfs: " Pieter Smith
2014-11-13 21:22 ` [PATCH 13/56] fs/ceph: " Pieter Smith
2014-11-13 21:22 ` [PATCH 14/56] fs/cifs: " Pieter Smith
2014-11-13 21:22 ` [PATCH 15/56] fs/coda: " Pieter Smith
2014-11-13 21:22 ` [PATCH 16/56] fs/encryptfs: " Pieter Smith
2014-11-13 21:22 ` [PATCH 17/56] fs/exofs: " Pieter Smith
2014-11-16  9:02   ` [osd-dev] " Boaz Harrosh
2014-11-13 21:22 ` [PATCH 18/56] fs/ext2: " Pieter Smith
2014-11-13 21:22 ` [PATCH 19/56] fs/ext3: " Pieter Smith
2014-11-13 21:22 ` [PATCH 20/56] fs/ext4: " Pieter Smith
2014-11-14  0:28   ` josh
2014-11-13 21:22 ` [PATCH 21/56] fs/f2fs: " Pieter Smith
2014-11-13 21:22 ` [PATCH 22/56] fs/fat: " Pieter Smith
2014-11-13 21:23 ` [PATCH 23/56] fs/fuse: " Pieter Smith
2014-11-13 21:23 ` [PATCH 24/56] fs/gfs2: " Pieter Smith
2014-11-13 21:23 ` [PATCH 25/56] fs/hfs: " Pieter Smith
2014-11-13 21:23 ` [PATCH 26/56] fs/hfsplus: " Pieter Smith
2014-11-13 21:23 ` [PATCH 27/56] fs/hostfs: " Pieter Smith
2014-11-13 21:23 ` [PATCH 28/56] fs/hpfs: " Pieter Smith
2014-11-13 21:23 ` [PATCH 29/56] fs/jffs2: " Pieter Smith
2014-11-13 21:23 ` [PATCH 30/56] fs/jfs: " Pieter Smith
2014-11-13 21:23 ` [PATCH 31/56] fs/minix: " Pieter Smith
2014-11-13 21:23 ` [PATCH 32/56] fs/nfs: " Pieter Smith
2014-11-13 21:23 ` [PATCH 33/56] fs/nfsd: " Pieter Smith
2014-11-13 21:23 ` [PATCH 34/56] fs/nilfs2: " Pieter Smith
2014-11-13 21:23 ` [PATCH 35/56] fs/ntfs: " Pieter Smith
2014-11-13 21:23 ` [PATCH 36/56] fs/ocfs2: " Pieter Smith
2014-11-13 21:23 ` [PATCH 37/56] fs/omfs: " Pieter Smith
2014-11-13 21:23 ` [PATCH 38/56] fs/ramfs: " Pieter Smith
2014-11-13 21:23 ` [PATCH 39/56] fs/reiserfs: " Pieter Smith
2014-11-13 21:23 ` [PATCH 40/56] fs/romfs: " Pieter Smith
2014-11-13 21:23 ` [PATCH 41/56] fs/sysv: " Pieter Smith
2014-11-13 21:23 ` [PATCH 42/56] fs/ubifs: " Pieter Smith
2014-11-13 21:23 ` [PATCH 43/56] fs/udf: " Pieter Smith
2014-11-13 21:23 ` [PATCH 44/56] fs/ufs: " Pieter Smith
2014-11-13 21:23 ` [PATCH 45/56] fs/xfs: " Pieter Smith
2014-11-13 21:23 ` [PATCH 46/56] kernel/relay: " Pieter Smith
2014-11-13 21:23 ` [PATCH 47/56] kenel/trace: " Pieter Smith
2014-11-17 20:33   ` Steven Rostedt
2014-11-13 21:23 ` [PATCH 48/56] mm/shmem: " Pieter Smith
2014-11-13 21:23 ` [PATCH 49/56] net/socket: " Pieter Smith
2014-11-13 21:23 ` [PATCH 50/56] fs/read_write: " Pieter Smith
2014-11-13 21:23 ` [PATCH 51/56] drivers/char/mem: " Pieter Smith
2014-11-13 22:09   ` Greg Kroah-Hartman
     [not found]     ` <CAPho-_JJGy0cwBVfWKL1Gt9ZQZM+Odo7W05bKQ2JLO+TM-ABJA@mail.gmail.com>
2014-11-13 22:31       ` josh
2014-11-13 23:34         ` Greg Kroah-Hartman
2014-11-14  0:19           ` josh
2014-11-14  3:27             ` Greg Kroah-Hartman
     [not found]               ` <CAPho-_KUc-+c=X6xtLTD2F-o4qi+YpYdnw6F1cx4kniezfs7aw@mail.gmail.com>
2014-11-14 23:25                 ` josh
     [not found]                 ` <CAPho-_LCj7bxJ2EvuZtBZXD1buH1V+nKEiobTJUATYmGYVRWcA@mail.gmail.com>
2014-11-16 18:20                   ` Josh Triplett
     [not found]                 ` <CAPho-_+ZXHYGB9-d19NR9u5tcOpN1Ytg80NZgvScF=YQ-6SdNA@mail.gmail.com>
2014-11-18 22:42                   ` josh
2014-11-13 21:23 ` [PATCH 52/56] drivers/char/virtio: " Pieter Smith
2014-11-13 22:09   ` Greg Kroah-Hartman
2014-11-13 21:23 ` [PATCH 53/56] net/ipv6: " Pieter Smith
2014-11-13 21:23 ` [PATCH 54/56] net/ipv4: " Pieter Smith
2014-11-13 21:23 ` [PATCH 55/56] net/core: " Pieter Smith
2014-11-13 21:23 ` [PATCH 56/56] fs/splice: full support for " Pieter Smith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).