aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJeff Layton <jlayton@primarydata.com>2014-11-26 14:44:44 -0500
committerTrond Myklebust <trond.myklebust@primarydata.com>2014-11-27 13:14:52 -0500
commit388f0c776781fe64ce951701bfe712b2182a31f2 (patch)
tree535e64ee7e52c96a16f80c2d71f2310d6f796b2b /include
parentb4b9d2ccf0be61c69213f6ae4e33377c05194ef4 (diff)
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>
Diffstat (limited to 'include')
-rw-r--r--include/linux/sunrpc/debug.h15
-rw-r--r--include/linux/sunrpc/xprt.h3
2 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h
index 835339707094..c57d8ea0716c 100644
--- a/include/linux/sunrpc/debug.h
+++ b/include/linux/sunrpc/debug.h
@@ -55,6 +55,7 @@ extern unsigned int nlm_debug;
55 */ 55 */
56 56
57struct rpc_clnt; 57struct rpc_clnt;
58struct rpc_xprt;
58 59
59#if IS_ENABLED(CONFIG_SUNRPC_DEBUG) 60#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
60void rpc_register_sysctl(void); 61void rpc_register_sysctl(void);
@@ -63,6 +64,8 @@ int sunrpc_debugfs_init(void);
63void sunrpc_debugfs_exit(void); 64void sunrpc_debugfs_exit(void);
64int rpc_clnt_debugfs_register(struct rpc_clnt *); 65int rpc_clnt_debugfs_register(struct rpc_clnt *);
65void rpc_clnt_debugfs_unregister(struct rpc_clnt *); 66void rpc_clnt_debugfs_unregister(struct rpc_clnt *);
67int rpc_xprt_debugfs_register(struct rpc_xprt *);
68void rpc_xprt_debugfs_unregister(struct rpc_xprt *);
66#else 69#else
67static inline int 70static inline int
68sunrpc_debugfs_init(void) 71sunrpc_debugfs_init(void)
@@ -87,6 +90,18 @@ rpc_clnt_debugfs_unregister(struct rpc_clnt *clnt)
87{ 90{
88 return; 91 return;
89} 92}
93
94static inline int
95rpc_xprt_debugfs_register(struct rpc_xprt *xprt)
96{
97 return 0;
98}
99
100static inline void
101rpc_xprt_debugfs_unregister(struct rpc_xprt *xprt)
102{
103 return;
104}
90#endif 105#endif
91 106
92#endif /* _LINUX_SUNRPC_DEBUG_H_ */ 107#endif /* _LINUX_SUNRPC_DEBUG_H_ */
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index cf391eef2e6d..9d27ac45b909 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -239,6 +239,9 @@ struct rpc_xprt {
239 struct net *xprt_net; 239 struct net *xprt_net;
240 const char *servername; 240 const char *servername;
241 const char *address_strings[RPC_DISPLAY_MAX]; 241 const char *address_strings[RPC_DISPLAY_MAX];
242#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
243 struct dentry *debugfs; /* debugfs directory */
244#endif
242}; 245};
243 246
244#if defined(CONFIG_SUNRPC_BACKCHANNEL) 247#if defined(CONFIG_SUNRPC_BACKCHANNEL)