diff options
Diffstat (limited to 'net/sunrpc/svc_xprt.c')
-rw-r--r-- | net/sunrpc/svc_xprt.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index 27d44332f017..df124f78ee48 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c | |||
@@ -160,6 +160,7 @@ void svc_xprt_init(struct svc_xprt_class *xcl, struct svc_xprt *xprt, | |||
160 | mutex_init(&xprt->xpt_mutex); | 160 | mutex_init(&xprt->xpt_mutex); |
161 | spin_lock_init(&xprt->xpt_lock); | 161 | spin_lock_init(&xprt->xpt_lock); |
162 | set_bit(XPT_BUSY, &xprt->xpt_flags); | 162 | set_bit(XPT_BUSY, &xprt->xpt_flags); |
163 | rpc_init_wait_queue(&xprt->xpt_bc_pending, "xpt_bc_pending"); | ||
163 | } | 164 | } |
164 | EXPORT_SYMBOL_GPL(svc_xprt_init); | 165 | EXPORT_SYMBOL_GPL(svc_xprt_init); |
165 | 166 | ||
@@ -710,10 +711,7 @@ int svc_recv(struct svc_rqst *rqstp, long timeout) | |||
710 | spin_unlock_bh(&pool->sp_lock); | 711 | spin_unlock_bh(&pool->sp_lock); |
711 | 712 | ||
712 | len = 0; | 713 | len = 0; |
713 | if (test_bit(XPT_CLOSE, &xprt->xpt_flags)) { | 714 | if (test_bit(XPT_LISTENER, &xprt->xpt_flags)) { |
714 | dprintk("svc_recv: found XPT_CLOSE\n"); | ||
715 | svc_delete_xprt(xprt); | ||
716 | } else if (test_bit(XPT_LISTENER, &xprt->xpt_flags)) { | ||
717 | struct svc_xprt *newxpt; | 715 | struct svc_xprt *newxpt; |
718 | newxpt = xprt->xpt_ops->xpo_accept(xprt); | 716 | newxpt = xprt->xpt_ops->xpo_accept(xprt); |
719 | if (newxpt) { | 717 | if (newxpt) { |
@@ -739,7 +737,7 @@ int svc_recv(struct svc_rqst *rqstp, long timeout) | |||
739 | svc_xprt_received(newxpt); | 737 | svc_xprt_received(newxpt); |
740 | } | 738 | } |
741 | svc_xprt_received(xprt); | 739 | svc_xprt_received(xprt); |
742 | } else { | 740 | } else if (!test_bit(XPT_CLOSE, &xprt->xpt_flags)) { |
743 | dprintk("svc: server %p, pool %u, transport %p, inuse=%d\n", | 741 | dprintk("svc: server %p, pool %u, transport %p, inuse=%d\n", |
744 | rqstp, pool->sp_id, xprt, | 742 | rqstp, pool->sp_id, xprt, |
745 | atomic_read(&xprt->xpt_ref.refcount)); | 743 | atomic_read(&xprt->xpt_ref.refcount)); |
@@ -752,6 +750,11 @@ int svc_recv(struct svc_rqst *rqstp, long timeout) | |||
752 | dprintk("svc: got len=%d\n", len); | 750 | dprintk("svc: got len=%d\n", len); |
753 | } | 751 | } |
754 | 752 | ||
753 | if (test_bit(XPT_CLOSE, &xprt->xpt_flags)) { | ||
754 | dprintk("svc_recv: found XPT_CLOSE\n"); | ||
755 | svc_delete_xprt(xprt); | ||
756 | } | ||
757 | |||
755 | /* No data, incomplete (TCP) read, or accept() */ | 758 | /* No data, incomplete (TCP) read, or accept() */ |
756 | if (len == 0 || len == -EAGAIN) { | 759 | if (len == 0 || len == -EAGAIN) { |
757 | rqstp->rq_res.len = 0; | 760 | rqstp->rq_res.len = 0; |
@@ -808,6 +811,7 @@ int svc_send(struct svc_rqst *rqstp) | |||
808 | else | 811 | else |
809 | len = xprt->xpt_ops->xpo_sendto(rqstp); | 812 | len = xprt->xpt_ops->xpo_sendto(rqstp); |
810 | mutex_unlock(&xprt->xpt_mutex); | 813 | mutex_unlock(&xprt->xpt_mutex); |
814 | rpc_wake_up(&xprt->xpt_bc_pending); | ||
811 | svc_xprt_release(rqstp); | 815 | svc_xprt_release(rqstp); |
812 | 816 | ||
813 | if (len == -ECONNREFUSED || len == -ENOTCONN || len == -EAGAIN) | 817 | if (len == -ECONNREFUSED || len == -ENOTCONN || len == -EAGAIN) |
@@ -1166,11 +1170,6 @@ static void *svc_pool_stats_start(struct seq_file *m, loff_t *pos) | |||
1166 | 1170 | ||
1167 | dprintk("svc_pool_stats_start, *pidx=%u\n", pidx); | 1171 | dprintk("svc_pool_stats_start, *pidx=%u\n", pidx); |
1168 | 1172 | ||
1169 | lock_kernel(); | ||
1170 | /* bump up the pseudo refcount while traversing */ | ||
1171 | svc_get(serv); | ||
1172 | unlock_kernel(); | ||
1173 | |||
1174 | if (!pidx) | 1173 | if (!pidx) |
1175 | return SEQ_START_TOKEN; | 1174 | return SEQ_START_TOKEN; |
1176 | return (pidx > serv->sv_nrpools ? NULL : &serv->sv_pools[pidx-1]); | 1175 | return (pidx > serv->sv_nrpools ? NULL : &serv->sv_pools[pidx-1]); |
@@ -1198,12 +1197,6 @@ static void *svc_pool_stats_next(struct seq_file *m, void *p, loff_t *pos) | |||
1198 | 1197 | ||
1199 | static void svc_pool_stats_stop(struct seq_file *m, void *p) | 1198 | static void svc_pool_stats_stop(struct seq_file *m, void *p) |
1200 | { | 1199 | { |
1201 | struct svc_serv *serv = m->private; | ||
1202 | |||
1203 | lock_kernel(); | ||
1204 | /* this function really, really should have been called svc_put() */ | ||
1205 | svc_destroy(serv); | ||
1206 | unlock_kernel(); | ||
1207 | } | 1200 | } |
1208 | 1201 | ||
1209 | static int svc_pool_stats_show(struct seq_file *m, void *p) | 1202 | static int svc_pool_stats_show(struct seq_file *m, void *p) |