Commit 6f903b11 authored by Trond Myklebust's avatar Trond Myklebust

SUNRPC: Remove the redundant 'zerocopy' argument to xs_sendpages()

Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent c87dc4c7
...@@ -776,11 +776,10 @@ static int xs_send_pagedata(struct socket *sock, struct msghdr *msg, struct xdr_ ...@@ -776,11 +776,10 @@ static int xs_send_pagedata(struct socket *sock, struct msghdr *msg, struct xdr_
* @addrlen: UDP only -- length of destination address * @addrlen: UDP only -- length of destination address
* @xdr: buffer containing this request * @xdr: buffer containing this request
* @base: starting position in the buffer * @base: starting position in the buffer
* @zerocopy: true if it is safe to use sendpage()
* @sent_p: return the total number of bytes successfully queued for sending * @sent_p: return the total number of bytes successfully queued for sending
* *
*/ */
static int xs_sendpages(struct socket *sock, struct sockaddr *addr, int addrlen, struct xdr_buf *xdr, unsigned int base, bool zerocopy, int *sent_p) static int xs_sendpages(struct socket *sock, struct sockaddr *addr, int addrlen, struct xdr_buf *xdr, unsigned int base, int *sent_p)
{ {
struct msghdr msg = { struct msghdr msg = {
.msg_name = addr, .msg_name = addr,
...@@ -935,7 +934,7 @@ static int xs_local_send_request(struct rpc_rqst *req) ...@@ -935,7 +934,7 @@ static int xs_local_send_request(struct rpc_rqst *req)
req->rq_xtime = ktime_get(); req->rq_xtime = ktime_get();
status = xs_sendpages(transport->sock, NULL, 0, xdr, status = xs_sendpages(transport->sock, NULL, 0, xdr,
transport->xmit.offset, transport->xmit.offset,
true, &sent); &sent);
dprintk("RPC: %s(%u) = %d\n", dprintk("RPC: %s(%u) = %d\n",
__func__, xdr->len - transport->xmit.offset, status); __func__, xdr->len - transport->xmit.offset, status);
...@@ -1002,7 +1001,7 @@ static int xs_udp_send_request(struct rpc_rqst *req) ...@@ -1002,7 +1001,7 @@ static int xs_udp_send_request(struct rpc_rqst *req)
req->rq_xtime = ktime_get(); req->rq_xtime = ktime_get();
status = xs_sendpages(transport->sock, xs_addr(xprt), xprt->addrlen, status = xs_sendpages(transport->sock, xs_addr(xprt), xprt->addrlen,
xdr, 0, true, &sent); xdr, 0, &sent);
dprintk("RPC: xs_udp_send_request(%u) = %d\n", dprintk("RPC: xs_udp_send_request(%u) = %d\n",
xdr->len, status); xdr->len, status);
...@@ -1066,7 +1065,6 @@ static int xs_tcp_send_request(struct rpc_rqst *req) ...@@ -1066,7 +1065,6 @@ static int xs_tcp_send_request(struct rpc_rqst *req)
struct rpc_xprt *xprt = req->rq_xprt; struct rpc_xprt *xprt = req->rq_xprt;
struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt);
struct xdr_buf *xdr = &req->rq_snd_buf; struct xdr_buf *xdr = &req->rq_snd_buf;
bool zerocopy = true;
bool vm_wait = false; bool vm_wait = false;
int status; int status;
int sent; int sent;
...@@ -1083,12 +1081,6 @@ static int xs_tcp_send_request(struct rpc_rqst *req) ...@@ -1083,12 +1081,6 @@ static int xs_tcp_send_request(struct rpc_rqst *req)
xs_pktdump("packet data:", xs_pktdump("packet data:",
req->rq_svec->iov_base, req->rq_svec->iov_base,
req->rq_svec->iov_len); req->rq_svec->iov_len);
/* Don't use zero copy if this is a resend. If the RPC call
* completes while the socket holds a reference to the pages,
* then we may end up resending corrupted data.
*/
if (req->rq_task->tk_flags & RPC_TASK_SENT)
zerocopy = false;
if (test_bit(XPRT_SOCK_UPD_TIMEOUT, &transport->sock_state)) if (test_bit(XPRT_SOCK_UPD_TIMEOUT, &transport->sock_state))
xs_tcp_set_socket_timeouts(xprt, transport->sock); xs_tcp_set_socket_timeouts(xprt, transport->sock);
...@@ -1101,7 +1093,7 @@ static int xs_tcp_send_request(struct rpc_rqst *req) ...@@ -1101,7 +1093,7 @@ static int xs_tcp_send_request(struct rpc_rqst *req)
sent = 0; sent = 0;
status = xs_sendpages(transport->sock, NULL, 0, xdr, status = xs_sendpages(transport->sock, NULL, 0, xdr,
transport->xmit.offset, transport->xmit.offset,
zerocopy, &sent); &sent);
dprintk("RPC: xs_tcp_send_request(%u) = %d\n", dprintk("RPC: xs_tcp_send_request(%u) = %d\n",
xdr->len - transport->xmit.offset, status); xdr->len - transport->xmit.offset, status);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment