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-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 23 Nov 2014 15:20:48 +0100
From:	Pieter Smith <pieter@...sman.nl>
To:	pieter@...sman.nl
Cc:	Josh Triplett <josh@...htriplett.org>,
	Alexander Duyck <alexander.h.duyck@...el.com>,
	Alexander Viro <viro@...iv.linux.org.uk>,
	Alexei Starovoitov <ast@...mgrid.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Bertrand Jacquin <beber@...eeweb.net>,
	Catalina Mocanu <catalina.mocanu@...il.com>,
	Daniel Borkmann <dborkman@...hat.com>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	"Eric W. Biederman" <ebiederm@...ssion.com>,
	Fabian Frederick <fabf@...net.be>,
	fuse-devel@...ts.sourceforge.net (open list:FUSE: FILESYSTEM...),
	Geert Uytterhoeven <geert@...ux-m68k.org>,
	Hugh Dickins <hughd@...gle.com>,
	Iulia Manda <iulia.manda21@...il.com>,
	Jan Beulich <JBeulich@...e.com>,
	"J. Bruce Fields" <bfields@...ldses.org>,
	Jeff Layton <jlayton@...chiereds.net>,
	linux-api@...r.kernel.org (open list:ABI/API),
	linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org (open list),
	"Luis R. Rodriguez" <mcgrof@...e.com>,
	Matt Turner <mattst88@...il.com>, Mel Gorman <mgorman@...e.de>,
	"Michael S. Tsirkin" <mst@...hat.com>,
	Miklos Szeredi <miklos@...redi.hu>,
	netdev@...r.kernel.org (open list:NETWORKING [GENERAL]),
	Oleg Nesterov <oleg@...hat.com>,
	Paul Durrant <Paul.Durrant@...rix.com>,
	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
	Peter Foley <pefoley2@...oley.com>,
	Thomas Graf <tgraf@...g.ch>, Tom Herbert <therbert@...gle.com>,
	Willem de Bruijn <willemb@...gle.com>,
	Xiao Guangrong <xiaoguangrong@...ux.vnet.ibm.com>,
	蔡正龙 <zhenglong.cai@...c.com.cn>
Subject: [PATCH 4/6] fs/fuse: support compiling out splice

To implement splice support, fs/fuse makes use of nosteal_pipe_buf_ops. This
struct is exported by fs/splice. The goal of the larger patch set is to
completely compile out fs/splice, so uses of the exported struct need to be
compiled out along with fs/splice.

This patch therefore compiles out splice support in fs/fuse when
CONFIG_SYSCALL_SPLICE is undefined.

Signed-off-by: Pieter Smith <pieter@...sman.nl>
---
 fs/fuse/dev.c      | 4 ++--
 include/linux/fs.h | 6 ++++++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index ca88731..f8f92a4 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -1291,7 +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));
 }
 
-static ssize_t fuse_dev_splice_read(struct file *in, loff_t *ppos,
+static ssize_t __maybe_unused fuse_dev_splice_read(struct file *in, loff_t *ppos,
 				    struct pipe_inode_info *pipe,
 				    size_t len, unsigned int flags)
 {
@@ -2144,7 +2144,7 @@ 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	= __splice_p(fuse_dev_splice_read),
 	.write		= do_sync_write,
 	.aio_write	= fuse_dev_write,
 	.splice_write	= fuse_dev_splice_write,
diff --git a/include/linux/fs.h b/include/linux/fs.h
index a957d43..04c0975 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2443,6 +2443,12 @@ 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
+#define __splice_p(x) x
+#else
+#define __splice_p(x) NULL
+#endif
+
 /* fs/splice.c */
 extern ssize_t generic_file_splice_read(struct file *, loff_t *,
 		struct pipe_inode_info *, size_t, unsigned int);
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ