aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2018-03-27 10:49:38 -0400
committerJ. Bruce Fields <bfields@redhat.com>2018-04-03 15:08:09 -0400
commit989f881ebf77d70e883dd0fbcfa04a058d97f771 (patch)
tree2c9ab7de3394a05cc07f69062d63265627cbd25f
parent63a1b1569372860fdef9e25edfc2320766b2f4c2 (diff)
svc: Simplify ->xpo_secure_port
Clean up: Instead of returning a value that is used to set or clear a bit, just make ->xpo_secure_port mangle that bit, and return void. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r--include/linux/sunrpc/svc_xprt.h2
-rw-r--r--net/sunrpc/svc_xprt.c5
-rw-r--r--net/sunrpc/svcsock.c7
-rw-r--r--net/sunrpc/xprtrdma/svc_rdma_transport.c6
4 files changed, 10 insertions, 10 deletions
diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h
index 1caf7bc83306..19475acb68ea 100644
--- a/include/linux/sunrpc/svc_xprt.h
+++ b/include/linux/sunrpc/svc_xprt.h
@@ -25,7 +25,7 @@ struct svc_xprt_ops {
25 void (*xpo_release_rqst)(struct svc_rqst *); 25 void (*xpo_release_rqst)(struct svc_rqst *);
26 void (*xpo_detach)(struct svc_xprt *); 26 void (*xpo_detach)(struct svc_xprt *);
27 void (*xpo_free)(struct svc_xprt *); 27 void (*xpo_free)(struct svc_xprt *);
28 int (*xpo_secure_port)(struct svc_rqst *); 28 void (*xpo_secure_port)(struct svc_rqst *rqstp);
29 void (*xpo_kill_temp_xprt)(struct svc_xprt *); 29 void (*xpo_kill_temp_xprt)(struct svc_xprt *);
30}; 30};
31 31
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
index 6dca0f513c95..4e3b4c596bae 100644
--- a/net/sunrpc/svc_xprt.c
+++ b/net/sunrpc/svc_xprt.c
@@ -844,10 +844,7 @@ int svc_recv(struct svc_rqst *rqstp, long timeout)
844 844
845 clear_bit(XPT_OLD, &xprt->xpt_flags); 845 clear_bit(XPT_OLD, &xprt->xpt_flags);
846 846
847 if (xprt->xpt_ops->xpo_secure_port(rqstp)) 847 xprt->xpt_ops->xpo_secure_port(rqstp);
848 set_bit(RQ_SECURE, &rqstp->rq_flags);
849 else
850 clear_bit(RQ_SECURE, &rqstp->rq_flags);
851 rqstp->rq_chandle.defer = svc_defer; 848 rqstp->rq_chandle.defer = svc_defer;
852 rqstp->rq_xid = svc_getu32(&rqstp->rq_arg.head[0]); 849 rqstp->rq_xid = svc_getu32(&rqstp->rq_arg.head[0]);
853 850
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index 943f2a745cd5..9b6703588e35 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -391,9 +391,12 @@ static void svc_sock_setbufsize(struct socket *sock, unsigned int snd,
391 release_sock(sock->sk); 391 release_sock(sock->sk);
392} 392}
393 393
394static int svc_sock_secure_port(struct svc_rqst *rqstp) 394static void svc_sock_secure_port(struct svc_rqst *rqstp)
395{ 395{
396 return svc_port_is_privileged(svc_addr(rqstp)); 396 if (svc_port_is_privileged(svc_addr(rqstp)))
397 set_bit(RQ_SECURE, &rqstp->rq_flags);
398 else
399 clear_bit(RQ_SECURE, &rqstp->rq_flags);
397} 400}
398 401
399/* 402/*
diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c
index 7b2f4d3a2543..17da06d6b8e5 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_transport.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c
@@ -69,7 +69,7 @@ static void svc_rdma_release_rqst(struct svc_rqst *);
69static void svc_rdma_detach(struct svc_xprt *xprt); 69static void svc_rdma_detach(struct svc_xprt *xprt);
70static void svc_rdma_free(struct svc_xprt *xprt); 70static void svc_rdma_free(struct svc_xprt *xprt);
71static int svc_rdma_has_wspace(struct svc_xprt *xprt); 71static int svc_rdma_has_wspace(struct svc_xprt *xprt);
72static int svc_rdma_secure_port(struct svc_rqst *); 72static void svc_rdma_secure_port(struct svc_rqst *);
73static void svc_rdma_kill_temp_xprt(struct svc_xprt *); 73static void svc_rdma_kill_temp_xprt(struct svc_xprt *);
74 74
75static const struct svc_xprt_ops svc_rdma_ops = { 75static const struct svc_xprt_ops svc_rdma_ops = {
@@ -988,9 +988,9 @@ static int svc_rdma_has_wspace(struct svc_xprt *xprt)
988 return 1; 988 return 1;
989} 989}
990 990
991static int svc_rdma_secure_port(struct svc_rqst *rqstp) 991static void svc_rdma_secure_port(struct svc_rqst *rqstp)
992{ 992{
993 return 1; 993 set_bit(RQ_SECURE, &rqstp->rq_flags);
994} 994}
995 995
996static void svc_rdma_kill_temp_xprt(struct svc_xprt *xprt) 996static void svc_rdma_kill_temp_xprt(struct svc_xprt *xprt)