These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / staging / lustre / lustre / ptlrpc / sec_lproc.c
index 0d08145..bda9a77 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';
@@ -78,7 +74,7 @@ static int sptlrpc_info_lprocfs_seq_show(struct seq_file *seq, void *v)
        struct obd_device *dev = seq->private;
        struct client_obd *cli = &dev->u.cli;
        struct ptlrpc_sec *sec = NULL;
-       char           str[32];
+       char str[32];
 
        LASSERT(strcmp(dev->obd_type->typ_name, LUSTRE_OSC_NAME) == 0 ||
                strcmp(dev->obd_type->typ_name, LUSTRE_MDC_NAME) == 0 ||
@@ -102,14 +98,15 @@ static int sptlrpc_info_lprocfs_seq_show(struct seq_file *seq, void *v)
                   atomic_read(&sec->ps_refcount));
        seq_printf(seq, "nctx:    %d\n", atomic_read(&sec->ps_nctx));
        seq_printf(seq, "gc internal    %ld\n", sec->ps_gc_interval);
-       seq_printf(seq, "gc next        %ld\n",
+       seq_printf(seq, "gc next        %lld\n",
                   sec->ps_gc_interval ?
-                  sec->ps_gc_next - get_seconds() : 0);
+                  (s64)(sec->ps_gc_next - ktime_get_real_seconds()) : 0ll);
 
        sptlrpc_sec_put(sec);
 out:
        return 0;
 }
+
 LPROC_SEQ_FOPS_RO(sptlrpc_info_lprocfs);
 
 static int sptlrpc_ctxs_lprocfs_seq_show(struct seq_file *seq, void *v)
@@ -134,11 +131,12 @@ static int sptlrpc_ctxs_lprocfs_seq_show(struct seq_file *seq, void *v)
 out:
        return 0;
 }
+
 LPROC_SEQ_FOPS_RO(sptlrpc_ctxs_lprocfs);
 
 int sptlrpc_lprocfs_cliobd_attach(struct obd_device *dev)
 {
-       int     rc;
+       int rc;
 
        if (strcmp(dev->obd_type->typ_name, LUSTRE_OSC_NAME) != 0 &&
            strcmp(dev->obd_type->typ_name, LUSTRE_MDC_NAME) != 0 &&
@@ -148,16 +146,16 @@ int sptlrpc_lprocfs_cliobd_attach(struct obd_device *dev)
                return -EINVAL;
        }
 
-       rc = lprocfs_obd_seq_create(dev, "srpc_info", 0444,
-                                   &sptlrpc_info_lprocfs_fops, dev);
+       rc = ldebugfs_obd_seq_create(dev, "srpc_info", 0444,
+                                    &sptlrpc_info_lprocfs_fops, dev);
        if (rc) {
                CERROR("create proc entry srpc_info for %s: %d\n",
                       dev->obd_name, rc);
                return rc;
        }
 
-       rc = lprocfs_obd_seq_create(dev, "srpc_contexts", 0444,
-                                   &sptlrpc_ctxs_lprocfs_fops, dev);
+       rc = ldebugfs_obd_seq_create(dev, "srpc_contexts", 0444,
+                                    &sptlrpc_ctxs_lprocfs_fops, dev);
        if (rc) {
                CERROR("create proc entry srpc_contexts for %s: %d\n",
                       dev->obd_name, rc);
@@ -174,17 +172,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 +193,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);
 }