Whamcloud - gitweb
LU-13004 ptlrpc: Allow BULK_BUF_KIOV to accept a kvec
[fs/lustre-release.git] / lustre / ptlrpc / sec_lproc.c
index 37bca07..e3d99ac 100644 (file)
 
 #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';
@@ -251,33 +247,51 @@ int sptlrpc_lprocfs_cliobd_attach(struct obd_device *dev)
 }
 EXPORT_SYMBOL(sptlrpc_lprocfs_cliobd_attach);
 
-LPROC_SEQ_FOPS_RO(sptlrpc_proc_enc_pool);
+LDEBUGFS_SEQ_FOPS_RO(sptlrpc_proc_enc_pool);
+
 static struct lprocfs_vars sptlrpc_lprocfs_vars[] = {
        { .name =       "encrypt_page_pools",
          .fops =       &sptlrpc_proc_enc_pool_fops     },
        { NULL }
 };
 
+struct dentry *sptlrpc_debugfs_dir;
+EXPORT_SYMBOL(sptlrpc_debugfs_dir);
+
+struct proc_dir_entry *sptlrpc_lprocfs_dir;
+EXPORT_SYMBOL(sptlrpc_lprocfs_dir);
+
 int sptlrpc_lproc_init(void)
 {
        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;
        }
+
+       sptlrpc_lprocfs_dir = lprocfs_register("sptlrpc", proc_lustre_root,
+                                              NULL, NULL);
+       if (IS_ERR_OR_NULL(sptlrpc_lprocfs_dir)) {
+               rc = PTR_ERR(sptlrpc_lprocfs_dir);
+               rc = sptlrpc_lprocfs_dir ? PTR_ERR(sptlrpc_lprocfs_dir)
+                       : -ENOMEM;
+               sptlrpc_lprocfs_dir = NULL;
+       }
        return 0;
 }
 
 void sptlrpc_lproc_fini(void)
 {
-        if (sptlrpc_proc_root) {
-                lprocfs_remove(&sptlrpc_proc_root);
-                sptlrpc_proc_root = NULL;
-        }
+       debugfs_remove_recursive(sptlrpc_debugfs_dir);
+       sptlrpc_debugfs_dir = NULL;
+
+       if (!IS_ERR_OR_NULL(sptlrpc_lprocfs_dir))
+               lprocfs_remove(&sptlrpc_lprocfs_dir);
 }