From: James Simmons Date: Fri, 14 Feb 2025 17:54:42 +0000 (-0500) Subject: LU-8066 mdc: move complex proc to debugfs X-Git-Tag: 2.16.53~84 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=42c17d20e1d34c4dd63bc0ff0bdd94a11d2a6c7e;p=fs%2Flustre-release.git LU-8066 mdc: move complex proc to debugfs 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 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58089 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Timothy Day Reviewed-by: Oleg Drokin --- diff --git a/lustre/mdc/lproc_mdc.c b/lustre/mdc/lproc_mdc.c index ac74000..a471de7 100644 --- a/lustre/mdc/lproc_mdc.c +++ b/lustre/mdc/lproc_mdc.c @@ -19,6 +19,7 @@ #include #include #include + #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) diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c index c287606..a73ff1f 100644 --- a/lustre/obdclass/lprocfs_status.c +++ b/lustre/obdclass/lprocfs_status.c @@ -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);