sunrpc: remove dead code in svc_sock_setbufsize
authorChristoph Hellwig <hch@lst.de>
Mon, 8 Jan 2018 11:21:04 +0000 (12:21 +0100)
committerJ. Bruce Fields <bfields@redhat.com>
Mon, 5 Feb 2018 22:13:16 +0000 (17:13 -0500)
Setting values in struct sock directly is the usual method.  Remove
the long dead code using set_fs() and the related comment.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
net/sunrpc/svcsock.c

index ff8e06c..5884583 100644 (file)
@@ -384,25 +384,11 @@ static int svc_partial_recvfrom(struct svc_rqst *rqstp,
 static void svc_sock_setbufsize(struct socket *sock, unsigned int snd,
                                unsigned int rcv)
 {
-#if 0
-       mm_segment_t    oldfs;
-       oldfs = get_fs(); set_fs(KERNEL_DS);
-       sock_setsockopt(sock, SOL_SOCKET, SO_SNDBUF,
-                       (char*)&snd, sizeof(snd));
-       sock_setsockopt(sock, SOL_SOCKET, SO_RCVBUF,
-                       (char*)&rcv, sizeof(rcv));
-#else
-       /* sock_setsockopt limits use to sysctl_?mem_max,
-        * which isn't acceptable.  Until that is made conditional
-        * on not having CAP_SYS_RESOURCE or similar, we go direct...
-        * DaveM said I could!
-        */
        lock_sock(sock->sk);
        sock->sk->sk_sndbuf = snd * 2;
        sock->sk->sk_rcvbuf = rcv * 2;
        sock->sk->sk_write_space(sock->sk);
        release_sock(sock->sk);
-#endif
 }
 
 static int svc_sock_secure_port(struct svc_rqst *rqstp)