From patchwork Sun Nov 23 14:20:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pieter Smith X-Patchwork-Id: 413422 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id AFF04140120 for ; Mon, 24 Nov 2014 01:23:31 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751784AbaKWOWe (ORCPT ); Sun, 23 Nov 2014 09:22:34 -0500 Received: from mail-wi0-f174.google.com ([209.85.212.174]:65534 "EHLO mail-wi0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751701AbaKWOW2 (ORCPT ); Sun, 23 Nov 2014 09:22:28 -0500 Received: by mail-wi0-f174.google.com with SMTP id h11so3385546wiw.1 for ; Sun, 23 Nov 2014 06:22:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=O9hcekZw67k8UH/UN/jAoJhauEmtUMPerU56wfAKeks=; b=GBxhw6X9lE/wkvjZtOR3z1LfqotniaxzbBBkRGxBQwGtNzjXZFIoUEMv/0SNlsE1he ciCvnaquvyNHP8/gC3rpDtokJmh/YCN53beUqPgcjbt/HRZVcz2WRL8e651DcQ0tbyeU MqKcx8apbO2fMbRxmJ2LReLQZWaaO8HgNcrg8lKhms8c1Gq1I+Ps5WD2bsV89P8xXgAv BTSA9y0+eKtVubm3YCeP/udRt3VNbIlB9gIIUPc5qbglp1opl90qZoiB4DPg38A2Xwd1 QVcajauLxxWpbZYadV/vovut3x68Qeb4JHbnBg2PLjrjBmYUcrTZpmi2vI0rV89MJq6S 2M4A== X-Received: by 10.180.92.129 with SMTP id cm1mr13239053wib.33.1416752547087; Sun, 23 Nov 2014 06:22:27 -0800 (PST) Received: from localhost.localdomain (ip4da2e5c1.direct-adsl.nl. [77.162.229.193]) by mx.google.com with ESMTPSA id ek9sm7573765wib.21.2014.11.23.06.22.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 23 Nov 2014 06:22:26 -0800 (PST) From: Pieter Smith To: pieter@boesman.nl Cc: Josh Triplett , Alexander Duyck , Alexander Viro , Alexei Starovoitov , Andrew Morton , Bertrand Jacquin , Catalina Mocanu , Daniel Borkmann , "David S. Miller" , Eric Dumazet , "Eric W. Biederman" , Fabian Frederick , fuse-devel@lists.sourceforge.net (open list:FUSE: FILESYSTEM...), Geert Uytterhoeven , Hugh Dickins , Iulia Manda , Jan Beulich , "J. Bruce Fields" , Jeff Layton , linux-api@vger.kernel.org (open list:ABI/API), linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org (open list), "Luis R. Rodriguez" , Matt Turner , Mel Gorman , "Michael S. Tsirkin" , Miklos Szeredi , netdev@vger.kernel.org (open list:NETWORKING [GENERAL]), Oleg Nesterov , Paul Durrant , "Paul E. McKenney" , Peter Foley , Thomas Graf , Tom Herbert , Willem de Bruijn , Xiao Guangrong , =?UTF-8?q?=E8=94=A1=E6=AD=A3=E9=BE=99?= Subject: [PATCH 4/6] fs/fuse: support compiling out splice Date: Sun, 23 Nov 2014 15:20:48 +0100 Message-Id: <1416752468-1626-5-git-send-email-pieter@boesman.nl> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1416752468-1626-1-git-send-email-pieter@boesman.nl> References: <1416752468-1626-1-git-send-email-pieter@boesman.nl> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- 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);