aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/xprt.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/xprt.c')
-rw-r--r--net/sunrpc/xprt.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index fb92f51405c5..a3af02168af1 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -570,6 +570,7 @@ static void xprt_autoclose(struct work_struct *work)
570 570
571 xprt_disconnect(xprt); 571 xprt_disconnect(xprt);
572 xprt->ops->close(xprt); 572 xprt->ops->close(xprt);
573 clear_bit(XPRT_CLOSE_WAIT, &xprt->state);
573 xprt_release_write(xprt, NULL); 574 xprt_release_write(xprt, NULL);
574} 575}
575 576
@@ -588,6 +589,25 @@ void xprt_disconnect(struct rpc_xprt *xprt)
588} 589}
589EXPORT_SYMBOL_GPL(xprt_disconnect); 590EXPORT_SYMBOL_GPL(xprt_disconnect);
590 591
592/**
593 * xprt_force_disconnect - force a transport to disconnect
594 * @xprt: transport to disconnect
595 *
596 */
597void xprt_force_disconnect(struct rpc_xprt *xprt)
598{
599 /* Don't race with the test_bit() in xprt_clear_locked() */
600 spin_lock_bh(&xprt->transport_lock);
601 set_bit(XPRT_CLOSE_WAIT, &xprt->state);
602 /* Try to schedule an autoclose RPC call */
603 if (test_and_set_bit(XPRT_LOCKED, &xprt->state) == 0)
604 queue_work(rpciod_workqueue, &xprt->task_cleanup);
605 else if (xprt->snd_task != NULL)
606 rpc_wake_up_task(xprt->snd_task);
607 spin_unlock_bh(&xprt->transport_lock);
608}
609EXPORT_SYMBOL_GPL(xprt_force_disconnect);
610
591static void 611static void
592xprt_init_autodisconnect(unsigned long data) 612xprt_init_autodisconnect(unsigned long data)
593{ 613{