linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pieter Smith <pieter@boesman.nl>
To: pieter@boesman.nl
Cc: Josh Triplett <josh@joshtriplett.org>,
	Jeff Layton <jlayton@poochiereds.net>,
	"J. Bruce Fields" <bfields@fieldses.org>,
	linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org (open list)
Subject: [PATCH 04/56] fs: Macros to define splice file_operations
Date: Thu, 13 Nov 2014 22:22:41 +0100	[thread overview]
Message-ID: <1415913813-362-5-git-send-email-pieter@boesman.nl> (raw)
In-Reply-To: <1415913813-362-1-git-send-email-pieter@boesman.nl>

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

  parent reply	other threads:[~2014-11-13 21:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <pieter@boesman.nl>
     [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
     [not found]   ` <1415913813-362-1-git-send-email-pieter-qeJ+1H9vRZbz+pZb47iToQ@public.gmane.org>
2014-11-13 21:22     ` [PATCH 03/56] fs: Support compiling out splice-family syscalls Pieter Smith
2014-11-13 21:22   ` Pieter Smith [this message]
2014-11-13 21:49     ` [PATCH 04/56] fs: Macros to define splice file_operations Richard Weinberger
2014-11-13 22:24       ` josh
2014-11-13 21:51     ` Al Viro
2014-11-13 21:22   ` [PATCH 07/56] fs/affs: support compiling out splice 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: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 50/56] fs/read_write: " Pieter Smith
2014-11-13 21:23   ` [PATCH 56/56] fs/splice: full support for " Pieter Smith

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1415913813-362-5-git-send-email-pieter@boesman.nl \
    --to=pieter@boesman.nl \
    --cc=bfields@fieldses.org \
    --cc=jlayton@poochiereds.net \
    --cc=josh@joshtriplett.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).