Netdev List
 help / color / mirror / Atom feed
From: Pieter Smith <pieter@boesman.nl>
To: pieter@boesman.nl
Cc: Josh Triplett <josh@joshtriplett.org>,
	"David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org (open list:NETWORKING [GENERAL]),
	linux-kernel@vger.kernel.org (open list)
Subject: [PATCH 49/56] net/socket: support compiling out splice
Date: Thu, 13 Nov 2014 22:23:26 +0100	[thread overview]
Message-ID: <1415913813-362-50-git-send-email-pieter@boesman.nl> (raw)
In-Reply-To: <1415913813-362-1-git-send-email-pieter@boesman.nl>

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

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

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1415913813-362-1-git-send-email-pieter@boesman.nl>
2014-11-13 21:23 ` Pieter Smith [this message]
2014-11-13 21:23 ` [PATCH 53/56] net/ipv6: support compiling out splice 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

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-50-git-send-email-pieter@boesman.nl \
    --to=pieter@boesman.nl \
    --cc=davem@davemloft.net \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@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