diff options
Diffstat (limited to 'net/sunrpc/xprtsock.c')
-rw-r--r-- | net/sunrpc/xprtsock.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index c1d8476b7692..3d02130828da 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c | |||
@@ -849,6 +849,14 @@ static void xs_tcp_close(struct rpc_xprt *xprt) | |||
849 | xs_tcp_shutdown(xprt); | 849 | xs_tcp_shutdown(xprt); |
850 | } | 850 | } |
851 | 851 | ||
852 | static void xs_local_destroy(struct rpc_xprt *xprt) | ||
853 | { | ||
854 | xs_close(xprt); | ||
855 | xs_free_peer_addresses(xprt); | ||
856 | xprt_free(xprt); | ||
857 | module_put(THIS_MODULE); | ||
858 | } | ||
859 | |||
852 | /** | 860 | /** |
853 | * xs_destroy - prepare to shutdown a transport | 861 | * xs_destroy - prepare to shutdown a transport |
854 | * @xprt: doomed transport | 862 | * @xprt: doomed transport |
@@ -862,10 +870,7 @@ static void xs_destroy(struct rpc_xprt *xprt) | |||
862 | 870 | ||
863 | cancel_delayed_work_sync(&transport->connect_worker); | 871 | cancel_delayed_work_sync(&transport->connect_worker); |
864 | 872 | ||
865 | xs_close(xprt); | 873 | xs_local_destroy(xprt); |
866 | xs_free_peer_addresses(xprt); | ||
867 | xprt_free(xprt); | ||
868 | module_put(THIS_MODULE); | ||
869 | } | 874 | } |
870 | 875 | ||
871 | static inline struct rpc_xprt *xprt_from_sock(struct sock *sk) | 876 | static inline struct rpc_xprt *xprt_from_sock(struct sock *sk) |
@@ -2482,7 +2487,7 @@ static struct rpc_xprt_ops xs_local_ops = { | |||
2482 | .send_request = xs_local_send_request, | 2487 | .send_request = xs_local_send_request, |
2483 | .set_retrans_timeout = xprt_set_retrans_timeout_def, | 2488 | .set_retrans_timeout = xprt_set_retrans_timeout_def, |
2484 | .close = xs_close, | 2489 | .close = xs_close, |
2485 | .destroy = xs_destroy, | 2490 | .destroy = xs_local_destroy, |
2486 | .print_stats = xs_local_print_stats, | 2491 | .print_stats = xs_local_print_stats, |
2487 | }; | 2492 | }; |
2488 | 2493 | ||