summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVasily Averin <vvs@virtuozzo.com>2018-12-24 06:46:00 -0500
committerJ. Bruce Fields <bfields@redhat.com>2018-12-27 21:01:41 -0500
commit64e20ba204df539a76004114e08abf1156302e35 (patch)
tree102fc8a0d5a5010df66946413d894468ac755ad8
parent7ef88ff85ff71dd167d29d47bdb91c63cedcd554 (diff)
sunrpc: remove unused xpo_prep_reply_hdr callback
xpo_prep_reply_hdr are not used now. It was defined for tcp transport only, however it cannot be called indirectly, so let's move it to its caller and remove unused callback. Signed-off-by: Vasily Averin <vvs@virtuozzo.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r--include/linux/sunrpc/svc_rdma.h1
-rw-r--r--include/linux/sunrpc/svc_xprt.h1
-rw-r--r--net/sunrpc/svc.c11
-rw-r--r--net/sunrpc/svcsock.c17
-rw-r--r--net/sunrpc/xprtrdma/svc_rdma_sendto.c4
-rw-r--r--net/sunrpc/xprtrdma/svc_rdma_transport.c1
6 files changed, 11 insertions, 24 deletions
diff --git a/include/linux/sunrpc/svc_rdma.h b/include/linux/sunrpc/svc_rdma.h
index 7e22681333d0..981f0d726ad4 100644
--- a/include/linux/sunrpc/svc_rdma.h
+++ b/include/linux/sunrpc/svc_rdma.h
@@ -193,7 +193,6 @@ extern int svc_rdma_sendto(struct svc_rqst *);
193extern int svc_rdma_create_listen(struct svc_serv *, int, struct sockaddr *); 193extern int svc_rdma_create_listen(struct svc_serv *, int, struct sockaddr *);
194extern void svc_sq_reap(struct svcxprt_rdma *); 194extern void svc_sq_reap(struct svcxprt_rdma *);
195extern void svc_rq_reap(struct svcxprt_rdma *); 195extern void svc_rq_reap(struct svcxprt_rdma *);
196extern void svc_rdma_prep_reply_hdr(struct svc_rqst *);
197 196
198extern struct svc_xprt_class svc_rdma_class; 197extern struct svc_xprt_class svc_rdma_class;
199#ifdef CONFIG_SUNRPC_BACKCHANNEL 198#ifdef CONFIG_SUNRPC_BACKCHANNEL
diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h
index 6b7a86c4d6e6..b3f9577e17d6 100644
--- a/include/linux/sunrpc/svc_xprt.h
+++ b/include/linux/sunrpc/svc_xprt.h
@@ -20,7 +20,6 @@ struct svc_xprt_ops {
20 struct svc_xprt *(*xpo_accept)(struct svc_xprt *); 20 struct svc_xprt *(*xpo_accept)(struct svc_xprt *);
21 int (*xpo_has_wspace)(struct svc_xprt *); 21 int (*xpo_has_wspace)(struct svc_xprt *);
22 int (*xpo_recvfrom)(struct svc_rqst *); 22 int (*xpo_recvfrom)(struct svc_rqst *);
23 void (*xpo_prep_reply_hdr)(struct svc_rqst *);
24 int (*xpo_sendto)(struct svc_rqst *); 23 int (*xpo_sendto)(struct svc_rqst *);
25 void (*xpo_release_rqst)(struct svc_rqst *); 24 void (*xpo_release_rqst)(struct svc_rqst *);
26 void (*xpo_detach)(struct svc_xprt *); 25 void (*xpo_detach)(struct svc_xprt *);
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index fb647bc01fc5..1e6701c065f9 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -1145,6 +1145,17 @@ static __printf(2,3) void svc_printk(struct svc_rqst *rqstp, const char *fmt, ..
1145#endif 1145#endif
1146 1146
1147/* 1147/*
1148 * Setup response header for TCP, it has a 4B record length field.
1149 */
1150static void svc_tcp_prep_reply_hdr(struct svc_rqst *rqstp)
1151{
1152 struct kvec *resv = &rqstp->rq_res.head[0];
1153
1154 /* tcp needs a space for the record length... */
1155 svc_putnl(resv, 0);
1156}
1157
1158/*
1148 * Common routine for processing the RPC request. 1159 * Common routine for processing the RPC request.
1149 */ 1160 */
1150static int 1161static int
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index 19acf10dfca1..c7ae1ed5324f 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -610,10 +610,6 @@ svc_udp_sendto(struct svc_rqst *rqstp)
610 return error; 610 return error;
611} 611}
612 612
613static void svc_udp_prep_reply_hdr(struct svc_rqst *rqstp)
614{
615}
616
617static int svc_udp_has_wspace(struct svc_xprt *xprt) 613static int svc_udp_has_wspace(struct svc_xprt *xprt)
618{ 614{
619 struct svc_sock *svsk = container_of(xprt, struct svc_sock, sk_xprt); 615 struct svc_sock *svsk = container_of(xprt, struct svc_sock, sk_xprt);
@@ -657,7 +653,6 @@ static const struct svc_xprt_ops svc_udp_ops = {
657 .xpo_release_rqst = svc_release_udp_skb, 653 .xpo_release_rqst = svc_release_udp_skb,
658 .xpo_detach = svc_sock_detach, 654 .xpo_detach = svc_sock_detach,
659 .xpo_free = svc_sock_free, 655 .xpo_free = svc_sock_free,
660 .xpo_prep_reply_hdr = svc_udp_prep_reply_hdr,
661 .xpo_has_wspace = svc_udp_has_wspace, 656 .xpo_has_wspace = svc_udp_has_wspace,
662 .xpo_accept = svc_udp_accept, 657 .xpo_accept = svc_udp_accept,
663 .xpo_secure_port = svc_sock_secure_port, 658 .xpo_secure_port = svc_sock_secure_port,
@@ -1163,17 +1158,6 @@ static int svc_tcp_sendto(struct svc_rqst *rqstp)
1163 return sent; 1158 return sent;
1164} 1159}
1165 1160
1166/*
1167 * Setup response header. TCP has a 4B record length field.
1168 */
1169void svc_tcp_prep_reply_hdr(struct svc_rqst *rqstp)
1170{
1171 struct kvec *resv = &rqstp->rq_res.head[0];
1172
1173 /* tcp needs a space for the record length... */
1174 svc_putnl(resv, 0);
1175}
1176
1177static struct svc_xprt *svc_tcp_create(struct svc_serv *serv, 1161static struct svc_xprt *svc_tcp_create(struct svc_serv *serv,
1178 struct net *net, 1162 struct net *net,
1179 struct sockaddr *sa, int salen, 1163 struct sockaddr *sa, int salen,
@@ -1189,7 +1173,6 @@ static const struct svc_xprt_ops svc_tcp_ops = {
1189 .xpo_release_rqst = svc_release_skb, 1173 .xpo_release_rqst = svc_release_skb,
1190 .xpo_detach = svc_tcp_sock_detach, 1174 .xpo_detach = svc_tcp_sock_detach,
1191 .xpo_free = svc_sock_free, 1175 .xpo_free = svc_sock_free,
1192 .xpo_prep_reply_hdr = svc_tcp_prep_reply_hdr,
1193 .xpo_has_wspace = svc_tcp_has_wspace, 1176 .xpo_has_wspace = svc_tcp_has_wspace,
1194 .xpo_accept = svc_tcp_accept, 1177 .xpo_accept = svc_tcp_accept,
1195 .xpo_secure_port = svc_sock_secure_port, 1178 .xpo_secure_port = svc_sock_secure_port,
diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
index d48bc6dd7b96..cf51b8f9b15f 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
@@ -714,10 +714,6 @@ static int svc_rdma_send_error_msg(struct svcxprt_rdma *rdma,
714 return 0; 714 return 0;
715} 715}
716 716
717void svc_rdma_prep_reply_hdr(struct svc_rqst *rqstp)
718{
719}
720
721/** 717/**
722 * svc_rdma_sendto - Transmit an RPC reply 718 * svc_rdma_sendto - Transmit an RPC reply
723 * @rqstp: processed RPC request, reply XDR already in ::rq_res 719 * @rqstp: processed RPC request, reply XDR already in ::rq_res
diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c
index 085933cc6b3e..924c17d46903 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_transport.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c
@@ -85,7 +85,6 @@ static const struct svc_xprt_ops svc_rdma_ops = {
85 .xpo_release_rqst = svc_rdma_release_rqst, 85 .xpo_release_rqst = svc_rdma_release_rqst,
86 .xpo_detach = svc_rdma_detach, 86 .xpo_detach = svc_rdma_detach,
87 .xpo_free = svc_rdma_free, 87 .xpo_free = svc_rdma_free,
88 .xpo_prep_reply_hdr = svc_rdma_prep_reply_hdr,
89 .xpo_has_wspace = svc_rdma_has_wspace, 88 .xpo_has_wspace = svc_rdma_has_wspace,
90 .xpo_accept = svc_rdma_accept, 89 .xpo_accept = svc_rdma_accept,
91 .xpo_secure_port = svc_rdma_secure_port, 90 .xpo_secure_port = svc_rdma_secure_port,