Skip to content

Commit

Permalink
SUNRPC: Further cleanups of xs_sendpages()
Browse files Browse the repository at this point in the history
Now that we send the pages using a struct msghdr, instead of
using sendpage(), we no longer need to 'prime the socket' with
an address for unconnected UDP messages.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
  • Loading branch information
Trond Myklebust committed Feb 20, 2019
1 parent 0472e47 commit c87dc4c
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions net/sunrpc/xprtsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -751,10 +751,6 @@ static int xs_sendmsg(struct socket *sock, struct msghdr *msg, size_t seek)

static int xs_send_kvec(struct socket *sock, struct msghdr *msg, struct kvec *vec, size_t seek)
{
if (!vec) {
iov_iter_kvec(&msg->msg_iter, WRITE, NULL, 0, 0);
return sock_sendmsg(sock, msg);
}
iov_iter_kvec(&msg->msg_iter, WRITE, vec, 1, vec->iov_len);
return xs_sendmsg(sock, msg, seek);
}
Expand Down Expand Up @@ -797,12 +793,7 @@ static int xs_sendpages(struct socket *sock, struct sockaddr *addr, int addrlen,
if (unlikely(!sock))
return -ENOTSOCK;

if (base != 0) {
addr = NULL;
addrlen = 0;
}

if (base < xdr->head[0].iov_len || addr != NULL) {
if (base < xdr->head[0].iov_len) {
unsigned int len = xdr->head[0].iov_len - base;
remainder -= len;
if (remainder == 0)
Expand Down

0 comments on commit c87dc4c

Please sign in to comment.