sunrpc: add debugfs file for displaying client rpc_task queue
[firefly-linux-kernel-4.4.55.git] / net / sunrpc / sunrpc_syms.c
index cd30120de9e4eb7ba413135dd2eb690311d784cb..e37fbed879568da535aa540656e7b7ace508e2cb 100644 (file)
@@ -97,13 +97,20 @@ init_sunrpc(void)
        err = register_rpc_pipefs();
        if (err)
                goto out4;
-#ifdef RPC_DEBUG
+
+       err = sunrpc_debugfs_init();
+       if (err)
+               goto out5;
+
+#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
        rpc_register_sysctl();
 #endif
        svc_init_xprt_sock();   /* svc sock transport */
        init_socket_xprt();     /* clnt sock transport */
        return 0;
 
+out5:
+       unregister_rpc_pipefs();
 out4:
        unregister_pernet_subsys(&sunrpc_net_ops);
 out3:
@@ -120,10 +127,11 @@ cleanup_sunrpc(void)
        rpcauth_remove_module();
        cleanup_socket_xprt();
        svc_cleanup_xprt_sock();
+       sunrpc_debugfs_exit();
        unregister_rpc_pipefs();
        rpc_destroy_mempool();
        unregister_pernet_subsys(&sunrpc_net_ops);
-#ifdef RPC_DEBUG
+#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
        rpc_unregister_sysctl();
 #endif
        rcu_barrier(); /* Wait for completion of call_rcu()'s */