diff options
Diffstat (limited to 'net/sunrpc/svcsock.c')
-rw-r--r-- | net/sunrpc/svcsock.c | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index ef3238d665ee..5763e6460fea 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c | |||
@@ -59,6 +59,7 @@ static void svc_udp_data_ready(struct sock *, int); | |||
59 | static int svc_udp_recvfrom(struct svc_rqst *); | 59 | static int svc_udp_recvfrom(struct svc_rqst *); |
60 | static int svc_udp_sendto(struct svc_rqst *); | 60 | static int svc_udp_sendto(struct svc_rqst *); |
61 | static void svc_sock_detach(struct svc_xprt *); | 61 | static void svc_sock_detach(struct svc_xprt *); |
62 | static void svc_tcp_sock_detach(struct svc_xprt *); | ||
62 | static void svc_sock_free(struct svc_xprt *); | 63 | static void svc_sock_free(struct svc_xprt *); |
63 | 64 | ||
64 | static struct svc_xprt *svc_create_socket(struct svc_serv *, int, | 65 | static struct svc_xprt *svc_create_socket(struct svc_serv *, int, |
@@ -102,7 +103,6 @@ static void svc_reclassify_socket(struct socket *sock) | |||
102 | static void svc_release_skb(struct svc_rqst *rqstp) | 103 | static void svc_release_skb(struct svc_rqst *rqstp) |
103 | { | 104 | { |
104 | struct sk_buff *skb = rqstp->rq_xprt_ctxt; | 105 | struct sk_buff *skb = rqstp->rq_xprt_ctxt; |
105 | struct svc_deferred_req *dr = rqstp->rq_deferred; | ||
106 | 106 | ||
107 | if (skb) { | 107 | if (skb) { |
108 | struct svc_sock *svsk = | 108 | struct svc_sock *svsk = |
@@ -112,10 +112,6 @@ static void svc_release_skb(struct svc_rqst *rqstp) | |||
112 | dprintk("svc: service %p, releasing skb %p\n", rqstp, skb); | 112 | dprintk("svc: service %p, releasing skb %p\n", rqstp, skb); |
113 | skb_free_datagram(svsk->sk_sk, skb); | 113 | skb_free_datagram(svsk->sk_sk, skb); |
114 | } | 114 | } |
115 | if (dr) { | ||
116 | rqstp->rq_deferred = NULL; | ||
117 | kfree(dr); | ||
118 | } | ||
119 | } | 115 | } |
120 | 116 | ||
121 | union svc_pktinfo_u { | 117 | union svc_pktinfo_u { |
@@ -289,7 +285,7 @@ svc_sock_names(char *buf, struct svc_serv *serv, char *toclose) | |||
289 | return -ENOENT; | 285 | return -ENOENT; |
290 | return len; | 286 | return len; |
291 | } | 287 | } |
292 | EXPORT_SYMBOL(svc_sock_names); | 288 | EXPORT_SYMBOL_GPL(svc_sock_names); |
293 | 289 | ||
294 | /* | 290 | /* |
295 | * Check input queue length | 291 | * Check input queue length |
@@ -1017,7 +1013,7 @@ static struct svc_xprt_ops svc_tcp_ops = { | |||
1017 | .xpo_recvfrom = svc_tcp_recvfrom, | 1013 | .xpo_recvfrom = svc_tcp_recvfrom, |
1018 | .xpo_sendto = svc_tcp_sendto, | 1014 | .xpo_sendto = svc_tcp_sendto, |
1019 | .xpo_release_rqst = svc_release_skb, | 1015 | .xpo_release_rqst = svc_release_skb, |
1020 | .xpo_detach = svc_sock_detach, | 1016 | .xpo_detach = svc_tcp_sock_detach, |
1021 | .xpo_free = svc_sock_free, | 1017 | .xpo_free = svc_sock_free, |
1022 | .xpo_prep_reply_hdr = svc_tcp_prep_reply_hdr, | 1018 | .xpo_prep_reply_hdr = svc_tcp_prep_reply_hdr, |
1023 | .xpo_has_wspace = svc_tcp_has_wspace, | 1019 | .xpo_has_wspace = svc_tcp_has_wspace, |
@@ -1101,7 +1097,7 @@ void svc_sock_update_bufs(struct svc_serv *serv) | |||
1101 | } | 1097 | } |
1102 | spin_unlock_bh(&serv->sv_lock); | 1098 | spin_unlock_bh(&serv->sv_lock); |
1103 | } | 1099 | } |
1104 | EXPORT_SYMBOL(svc_sock_update_bufs); | 1100 | EXPORT_SYMBOL_GPL(svc_sock_update_bufs); |
1105 | 1101 | ||
1106 | /* | 1102 | /* |
1107 | * Initialize socket for RPC use and create svc_sock struct | 1103 | * Initialize socket for RPC use and create svc_sock struct |
@@ -1287,6 +1283,24 @@ static void svc_sock_detach(struct svc_xprt *xprt) | |||
1287 | sk->sk_state_change = svsk->sk_ostate; | 1283 | sk->sk_state_change = svsk->sk_ostate; |
1288 | sk->sk_data_ready = svsk->sk_odata; | 1284 | sk->sk_data_ready = svsk->sk_odata; |
1289 | sk->sk_write_space = svsk->sk_owspace; | 1285 | sk->sk_write_space = svsk->sk_owspace; |
1286 | |||
1287 | if (sk->sk_sleep && waitqueue_active(sk->sk_sleep)) | ||
1288 | wake_up_interruptible(sk->sk_sleep); | ||
1289 | } | ||
1290 | |||
1291 | /* | ||
1292 | * Disconnect the socket, and reset the callbacks | ||
1293 | */ | ||
1294 | static void svc_tcp_sock_detach(struct svc_xprt *xprt) | ||
1295 | { | ||
1296 | struct svc_sock *svsk = container_of(xprt, struct svc_sock, sk_xprt); | ||
1297 | |||
1298 | dprintk("svc: svc_tcp_sock_detach(%p)\n", svsk); | ||
1299 | |||
1300 | svc_sock_detach(xprt); | ||
1301 | |||
1302 | if (!test_bit(XPT_LISTENER, &xprt->xpt_flags)) | ||
1303 | kernel_sock_shutdown(svsk->sk_sock, SHUT_RDWR); | ||
1290 | } | 1304 | } |
1291 | 1305 | ||
1292 | /* | 1306 | /* |