summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2007-02-12 00:53:31 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-12 09:48:35 -0800
commit1ba951053f07187f6e77be664a4b6f8bf0ba7ae4 (patch)
tree68e6e183de677269078de1b2ce6efc88249a3b33 /net
parent067d7817310569f7b76ca08c4d071ca95ad4c1d3 (diff)
downloadop-kernel-dev-1ba951053f07187f6e77be664a4b6f8bf0ba7ae4.zip
op-kernel-dev-1ba951053f07187f6e77be664a4b6f8bf0ba7ae4.tar.gz
[PATCH] knfsd: SUNRPC: Don't set msg_name and msg_namelen when calling sock_recvmsg
Clean-up: msg_name and msg_namelen are not used by sock_recvmsg, so don't bother to set them in svc_recvfrom. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/svcsock.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index 1f97ed4..a98be09 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -569,21 +569,13 @@ static int
svc_recvfrom(struct svc_rqst *rqstp, struct kvec *iov, int nr, int buflen)
{
struct svc_sock *svsk = rqstp->rq_sock;
- struct msghdr msg;
- struct socket *sock;
- int len;
-
- rqstp->rq_addrlen = sizeof(rqstp->rq_addr);
- sock = svsk->sk_sock;
-
- msg.msg_name = &rqstp->rq_addr;
- msg.msg_namelen = sizeof(rqstp->rq_addr);
- msg.msg_control = NULL;
- msg.msg_controllen = 0;
-
- msg.msg_flags = MSG_DONTWAIT;
+ struct msghdr msg = {
+ .msg_flags = MSG_DONTWAIT,
+ };
+ int len;
- len = kernel_recvmsg(sock, &msg, iov, nr, buflen, MSG_DONTWAIT);
+ len = kernel_recvmsg(svsk->sk_sock, &msg, iov, nr, buflen,
+ msg.msg_flags);
/* sock_recvmsg doesn't fill in the name/namelen, so we must..
*/
@@ -591,7 +583,7 @@ svc_recvfrom(struct svc_rqst *rqstp, struct kvec *iov, int nr, int buflen)
rqstp->rq_addrlen = svsk->sk_remotelen;
dprintk("svc: socket %p recvfrom(%p, %Zu) = %d\n",
- rqstp->rq_sock, iov[0].iov_base, iov[0].iov_len, len);
+ svsk, iov[0].iov_base, iov[0].iov_len, len);
return len;
}
OpenPOWER on IntegriCloud