lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1415913813-362-5-git-send-email-pieter@boesman.nl>
Date:	Thu, 13 Nov 2014 22:22:41 +0100
From:	Pieter Smith <pieter@...sman.nl>
To:	pieter@...sman.nl
Cc:	Josh Triplett <josh@...htriplett.org>,
	Jeff Layton <jlayton@...chiereds.net>,
	"J. Bruce Fields" <bfields@...ldses.org>,
	linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org (open list)
Subject: [PATCH 04/56] fs: Macros to define splice file_operations

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@...sman.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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ