diff options
author | Dmitry Eremin <dmiter4ever@gmail.com> | 2015-05-21 15:32:12 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-05-31 11:16:54 +0900 |
commit | 77386b3c0b4470db1ed546de858b31cac66fc943 (patch) | |
tree | c2f48543e43b163bfd150ed3db5ed845a8bde267 | |
parent | 700815d47f9da0477229f009b6fa235f20da1e21 (diff) | |
download | op-kernel-dev-77386b3c0b4470db1ed546de858b31cac66fc943.zip op-kernel-dev-77386b3c0b4470db1ed546de858b31cac66fc943.tar.gz |
staging/lustre/ptlrpc: move sptlrpc procfs entry to debugfs
We might want eventuall split it into a bunch of
single-value sysfs entries, I imagine, but there is no urgent need now.
Signed-off-by: Dmitry Eremin <dmiter4ever@gmail.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/lustre/lustre/include/lustre_sec.h | 8 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c | 27 |
2 files changed, 12 insertions, 23 deletions
diff --git a/drivers/staging/lustre/lustre/include/lustre_sec.h b/drivers/staging/lustre/lustre/include/lustre_sec.h index dff70a5..707ff69 100644 --- a/drivers/staging/lustre/lustre/include/lustre_sec.h +++ b/drivers/staging/lustre/lustre/include/lustre_sec.h @@ -1061,15 +1061,7 @@ const char *sec2target_str(struct ptlrpc_sec *sec); /* * lprocfs */ -#if defined (CONFIG_PROC_FS) -struct proc_dir_entry; -extern struct proc_dir_entry *sptlrpc_proc_root; int sptlrpc_lprocfs_cliobd_attach(struct obd_device *dev); -#else -#define sptlrpc_proc_root NULL -static inline int sptlrpc_lprocfs_cliobd_attach(struct obd_device *dev) -{ return 0; } -#endif /* * server side diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c b/drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c index 0d08145..549515d 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c @@ -51,10 +51,6 @@ #include "ptlrpc_internal.h" - -struct proc_dir_entry *sptlrpc_proc_root = NULL; -EXPORT_SYMBOL(sptlrpc_proc_root); - static char *sec_flags2str(unsigned long flags, char *buf, int bufsize) { buf[0] = '\0'; @@ -174,17 +170,20 @@ static struct lprocfs_vars sptlrpc_lprocfs_vars[] = { { NULL } }; +static struct dentry *sptlrpc_debugfs_dir; + int sptlrpc_lproc_init(void) { - int rc; + int rc; - LASSERT(sptlrpc_proc_root == NULL); + LASSERT(sptlrpc_debugfs_dir == NULL); - sptlrpc_proc_root = lprocfs_register("sptlrpc", proc_lustre_root, - sptlrpc_lprocfs_vars, NULL); - if (IS_ERR(sptlrpc_proc_root)) { - rc = PTR_ERR(sptlrpc_proc_root); - sptlrpc_proc_root = NULL; + sptlrpc_debugfs_dir = ldebugfs_register("sptlrpc", debugfs_lustre_root, + sptlrpc_lprocfs_vars, NULL); + if (IS_ERR_OR_NULL(sptlrpc_debugfs_dir)) { + rc = sptlrpc_debugfs_dir ? PTR_ERR(sptlrpc_debugfs_dir) + : -ENOMEM; + sptlrpc_debugfs_dir = NULL; return rc; } return 0; @@ -192,8 +191,6 @@ int sptlrpc_lproc_init(void) void sptlrpc_lproc_fini(void) { - if (sptlrpc_proc_root) { - lprocfs_remove(&sptlrpc_proc_root); - sptlrpc_proc_root = NULL; - } + if (!IS_ERR_OR_NULL(sptlrpc_debugfs_dir)) + ldebugfs_remove(&sptlrpc_debugfs_dir); } |