sunrpc: add a debugfs rpc_xprt directory with an info file in it
Add a new directory heirarchy under the debugfs sunrpc/ directory: sunrpc/ rpc_xprt/ <xprt id>/ Within that directory, we can put files that give info about the xprts. We do have the (minor) problem that there is no succinct, unique identifier for rpc_xprts. So we generate them synthetically with a static atomic_t counter. For now, this directory just holds an "info" file, but we may add other files to it in the future. Signed-off-by: Jeff Layton <jlayton@primarydata.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
This commit is contained in:

committed by
Trond Myklebust

parent
b4b9d2ccf0
commit
388f0c7767
@@ -1303,6 +1303,7 @@ static void xprt_init(struct rpc_xprt *xprt, struct net *net)
|
||||
*/
|
||||
struct rpc_xprt *xprt_create_transport(struct xprt_create *args)
|
||||
{
|
||||
int err;
|
||||
struct rpc_xprt *xprt;
|
||||
struct xprt_class *t;
|
||||
|
||||
@@ -1343,6 +1344,12 @@ found:
|
||||
return ERR_PTR(-ENOMEM);
|
||||
}
|
||||
|
||||
err = rpc_xprt_debugfs_register(xprt);
|
||||
if (err) {
|
||||
xprt_destroy(xprt);
|
||||
return ERR_PTR(err);
|
||||
}
|
||||
|
||||
dprintk("RPC: created transport %p with %u slots\n", xprt,
|
||||
xprt->max_reqs);
|
||||
out:
|
||||
@@ -1359,6 +1366,7 @@ static void xprt_destroy(struct rpc_xprt *xprt)
|
||||
dprintk("RPC: destroying transport %p\n", xprt);
|
||||
del_timer_sync(&xprt->timer);
|
||||
|
||||
rpc_xprt_debugfs_unregister(xprt);
|
||||
rpc_destroy_wait_queue(&xprt->binding);
|
||||
rpc_destroy_wait_queue(&xprt->pending);
|
||||
rpc_destroy_wait_queue(&xprt->sending);
|
||||
|
Reference in New Issue
Block a user