Commit c87dc4c7 authored by Trond Myklebust's avatar Trond Myklebust

SUNRPC: Further cleanups of xs_sendpages()

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: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent 0472e476
...@@ -751,10 +751,6 @@ static int xs_sendmsg(struct socket *sock, struct msghdr *msg, size_t seek) ...@@ -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) 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); iov_iter_kvec(&msg->msg_iter, WRITE, vec, 1, vec->iov_len);
return xs_sendmsg(sock, msg, seek); return xs_sendmsg(sock, msg, seek);
} }
...@@ -797,12 +793,7 @@ static int xs_sendpages(struct socket *sock, struct sockaddr *addr, int addrlen, ...@@ -797,12 +793,7 @@ static int xs_sendpages(struct socket *sock, struct sockaddr *addr, int addrlen,
if (unlikely(!sock)) if (unlikely(!sock))
return -ENOTSOCK; return -ENOTSOCK;
if (base != 0) { if (base < xdr->head[0].iov_len) {
addr = NULL;
addrlen = 0;
}
if (base < xdr->head[0].iov_len || addr != NULL) {
unsigned int len = xdr->head[0].iov_len - base; unsigned int len = xdr->head[0].iov_len - base;
remainder -= len; remainder -= len;
if (remainder == 0) if (remainder == 0)
......
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