Whamcloud - gitweb
LU-8066 mdc: move complex proc to debugfs 89/58089/3
authorJames Simmons <jsimmons@infradead.org>
Fri, 14 Feb 2025 17:54:42 +0000 (12:54 -0500)
committerOleg Drokin <green@whamcloud.com>
Fri, 28 Feb 2025 08:15:29 +0000 (08:15 +0000)
Time to pull the trigger and move the complex proc files
to debugfs for the mdc layer.

Change-Id: Id4cc8a53ab581ec6a56578d6d23b3541946933e5
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58089
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Timothy Day <timday@amazon.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/mdc/lproc_mdc.c
lustre/obdclass/lprocfs_status.c

index ac74000..a471de7 100644 (file)
@@ -19,6 +19,7 @@
 #include <lprocfs_status.h>
 #include <lustre_osc.h>
 #include <cl_object.h>
+
 #include "mdc_internal.h"
 
 static ssize_t active_show(struct kobject *kobj, struct attribute *attr,
@@ -300,7 +301,7 @@ mdc_cached_mb_seq_write(struct file *file, const char __user *buffer,
 
        return count;
 }
-LPROC_SEQ_FOPS(mdc_cached_mb);
+LDEBUGFS_SEQ_FOPS(mdc_cached_mb);
 
 static ssize_t dom_min_repsize_show(struct kobject *kobj,
                                    struct attribute *attr, char *buf)
@@ -374,7 +375,7 @@ static int mdc_unstable_stats_seq_show(struct seq_file *m, void *v)
                   "unstable_mb:              %10d\n", pages, mb);
        return 0;
 }
-LPROC_SEQ_FOPS_RO(mdc_unstable_stats);
+LDEBUGFS_SEQ_FOPS_RO(mdc_unstable_stats);
 
 static ssize_t mdc_rpc_stats_seq_write(struct file *file,
                                       const char __user *buf,
@@ -489,7 +490,7 @@ static int mdc_rpc_stats_seq_show(struct seq_file *seq, void *v)
 
        return 0;
 }
-LPROC_SEQ_FOPS(mdc_rpc_stats);
+LDEBUGFS_SEQ_FOPS(mdc_rpc_stats);
 
 static ssize_t mdc_batch_stats_seq_write(struct file *file,
                                         const char __user *buf,
@@ -531,7 +532,7 @@ static int mdc_batch_stats_seq_show(struct seq_file *seq, void *v)
 
        return 0;
 }
-LPROC_SEQ_FOPS(mdc_batch_stats);
+LDEBUGFS_SEQ_FOPS(mdc_batch_stats);
 
 static int mdc_stats_seq_show(struct seq_file *seq, void *v)
 {
@@ -560,15 +561,15 @@ static ssize_t mdc_stats_seq_write(struct file *file,
 
        return len;
 }
-LPROC_SEQ_FOPS(mdc_stats);
+LDEBUGFS_SEQ_FOPS(mdc_stats);
 
-LPROC_SEQ_FOPS_RO_TYPE(mdc, connect_flags);
-LPROC_SEQ_FOPS_RO_TYPE(mdc, server_uuid);
-LPROC_SEQ_FOPS_RO_TYPE(mdc, timeouts);
-LPROC_SEQ_FOPS_RO_TYPE(mdc, state);
-LPROC_SEQ_FOPS_RW_TYPE(mdc, import);
+LDEBUGFS_SEQ_FOPS_RO_TYPE(mdc, connect_flags);
+LDEBUGFS_SEQ_FOPS_RO_TYPE(mdc, server_uuid);
+LDEBUGFS_SEQ_FOPS_RO_TYPE(mdc, timeouts);
+LDEBUGFS_SEQ_FOPS_RO_TYPE(mdc, state);
+LDEBUGFS_SEQ_FOPS_RW_TYPE(mdc, import);
 
-struct lprocfs_vars lprocfs_mdc_obd_vars[] = {
+struct ldebugfs_vars ldebugfs_mdc_obd_vars[] = {
        { .name =       "connect_flags",
          .fops =       &mdc_connect_flags_fops },
        { .name =       "mds_server_uuid",
@@ -732,7 +733,7 @@ int mdc_tunables_init(struct obd_device *obd)
        int rc;
 
        obd->obd_ktype.default_groups = KOBJ_ATTR_GROUPS(mdc);
-       obd->obd_vars = lprocfs_mdc_obd_vars;
+       obd->obd_debugfs_vars = ldebugfs_mdc_obd_vars;
 
        rc = lprocfs_obd_setup(obd, false);
        if (rc)
index c287606..a73ff1f 100644 (file)
@@ -1080,7 +1080,6 @@ static void obd_sysfs_release(struct kobject *kobj)
 
 int lprocfs_obd_setup(struct obd_device *obd, bool uuid_only)
 {
-       struct ldebugfs_vars *debugfs_vars = NULL;
        int rc;
 
        if (!obd || obd->obd_magic != OBD_DEVICE_MAGIC)
@@ -1111,11 +1110,9 @@ int lprocfs_obd_setup(struct obd_device *obd, bool uuid_only)
                return rc;
        }
 
-       if (!obd->obd_type->typ_procroot)
-               debugfs_vars = obd->obd_debugfs_vars;
-       obd->obd_debugfs_entry = debugfs_create_dir(
-               obd->obd_name, obd->obd_type->typ_debugfs_entry);
-       ldebugfs_add_vars(obd->obd_debugfs_entry, debugfs_vars, obd);
+       obd->obd_debugfs_entry = debugfs_create_dir(obd->obd_name,
+                                                   obd->obd_type->typ_debugfs_entry);
+       ldebugfs_add_vars(obd->obd_debugfs_entry, obd->obd_debugfs_vars, obd);
 
        if (obd->obd_proc_entry || !obd->obd_type->typ_procroot)
                GOTO(already_registered, rc);