Skip to content

Commit 6f903b1

Browse files
author
Trond Myklebust
committed
SUNRPC: Remove the redundant 'zerocopy' argument to xs_sendpages()
Signed-off-by: Trond Myklebust <[email protected]>
1 parent c87dc4c commit 6f903b1

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

net/sunrpc/xprtsock.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -776,11 +776,10 @@ static int xs_send_pagedata(struct socket *sock, struct msghdr *msg, struct xdr_
776776
* @addrlen: UDP only -- length of destination address
777777
* @xdr: buffer containing this request
778778
* @base: starting position in the buffer
779-
* @zerocopy: true if it is safe to use sendpage()
780779
* @sent_p: return the total number of bytes successfully queued for sending
781780
*
782781
*/
783-
static int xs_sendpages(struct socket *sock, struct sockaddr *addr, int addrlen, struct xdr_buf *xdr, unsigned int base, bool zerocopy, int *sent_p)
782+
static int xs_sendpages(struct socket *sock, struct sockaddr *addr, int addrlen, struct xdr_buf *xdr, unsigned int base, int *sent_p)
784783
{
785784
struct msghdr msg = {
786785
.msg_name = addr,
@@ -935,7 +934,7 @@ static int xs_local_send_request(struct rpc_rqst *req)
935934
req->rq_xtime = ktime_get();
936935
status = xs_sendpages(transport->sock, NULL, 0, xdr,
937936
transport->xmit.offset,
938-
true, &sent);
937+
&sent);
939938
dprintk("RPC: %s(%u) = %d\n",
940939
__func__, xdr->len - transport->xmit.offset, status);
941940

@@ -1002,7 +1001,7 @@ static int xs_udp_send_request(struct rpc_rqst *req)
10021001

10031002
req->rq_xtime = ktime_get();
10041003
status = xs_sendpages(transport->sock, xs_addr(xprt), xprt->addrlen,
1005-
xdr, 0, true, &sent);
1004+
xdr, 0, &sent);
10061005

10071006
dprintk("RPC: xs_udp_send_request(%u) = %d\n",
10081007
xdr->len, status);
@@ -1066,7 +1065,6 @@ static int xs_tcp_send_request(struct rpc_rqst *req)
10661065
struct rpc_xprt *xprt = req->rq_xprt;
10671066
struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt);
10681067
struct xdr_buf *xdr = &req->rq_snd_buf;
1069-
bool zerocopy = true;
10701068
bool vm_wait = false;
10711069
int status;
10721070
int sent;
@@ -1083,12 +1081,6 @@ static int xs_tcp_send_request(struct rpc_rqst *req)
10831081
xs_pktdump("packet data:",
10841082
req->rq_svec->iov_base,
10851083
req->rq_svec->iov_len);
1086-
/* Don't use zero copy if this is a resend. If the RPC call
1087-
* completes while the socket holds a reference to the pages,
1088-
* then we may end up resending corrupted data.
1089-
*/
1090-
if (req->rq_task->tk_flags & RPC_TASK_SENT)
1091-
zerocopy = false;
10921084

10931085
if (test_bit(XPRT_SOCK_UPD_TIMEOUT, &transport->sock_state))
10941086
xs_tcp_set_socket_timeouts(xprt, transport->sock);
@@ -1101,7 +1093,7 @@ static int xs_tcp_send_request(struct rpc_rqst *req)
11011093
sent = 0;
11021094
status = xs_sendpages(transport->sock, NULL, 0, xdr,
11031095
transport->xmit.offset,
1104-
zerocopy, &sent);
1096+
&sent);
11051097

11061098
dprintk("RPC: xs_tcp_send_request(%u) = %d\n",
11071099
xdr->len - transport->xmit.offset, status);

0 commit comments

Comments
 (0)