From 2962b440dfe0357405a46e2afe1b6ff33de58465 Mon Sep 17 00:00:00 2001 From: Oleg Drokin Date: Thu, 21 May 2015 15:32:13 -0400 Subject: [PATCH] staging/lustre: Remove useless num_refs procfs variable Every obd type registers it, but it's not really needed by anybody. Remove all the supporting infrastructure too. Signed-off-by: Oleg Drokin Signed-off-by: Greg Kroah-Hartman --- drivers/staging/lustre/lustre/include/lprocfs_status.h | 2 -- drivers/staging/lustre/lustre/include/obd_class.h | 3 +-- drivers/staging/lustre/lustre/llite/lproc_llite.c | 1 - drivers/staging/lustre/lustre/lmv/lmv_obd.c | 2 +- drivers/staging/lustre/lustre/lmv/lproc_lmv.c | 8 -------- drivers/staging/lustre/lustre/lov/lov_obd.c | 2 +- drivers/staging/lustre/lustre/lov/lproc_lov.c | 8 -------- drivers/staging/lustre/lustre/mdc/lproc_mdc.c | 8 -------- drivers/staging/lustre/lustre/mdc/mdc_request.c | 2 +- drivers/staging/lustre/lustre/mgc/lproc_mgc.c | 7 ------- drivers/staging/lustre/lustre/mgc/mgc_request.c | 2 +- drivers/staging/lustre/lustre/obdclass/genops.c | 4 ++-- drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 10 ---------- drivers/staging/lustre/lustre/obdecho/echo_client.c | 1 - drivers/staging/lustre/lustre/obdecho/lproc_echo.c | 7 ------- drivers/staging/lustre/lustre/osc/lproc_osc.c | 7 ------- drivers/staging/lustre/lustre/osc/osc_request.c | 2 +- 17 files changed, 8 insertions(+), 68 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h b/drivers/staging/lustre/lustre/include/lprocfs_status.h index 313f394..48a0d56 100644 --- a/drivers/staging/lustre/lustre/include/lprocfs_status.h +++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h @@ -61,7 +61,6 @@ struct lprocfs_vars { }; struct lprocfs_static_vars { - struct lprocfs_vars *module_vars; struct lprocfs_vars *obd_vars; }; @@ -640,7 +639,6 @@ extern int lprocfs_rd_import(struct seq_file *m, void *data); extern int lprocfs_rd_state(struct seq_file *m, void *data); extern int lprocfs_rd_connect_flags(struct seq_file *m, void *data); extern int lprocfs_rd_num_exports(struct seq_file *m, void *data); -extern int lprocfs_rd_numrefs(struct seq_file *m, void *data); struct adaptive_timeout; extern int lprocfs_at_hist_helper(struct seq_file *m, diff --git a/drivers/staging/lustre/lustre/include/obd_class.h b/drivers/staging/lustre/lustre/include/obd_class.h index 34b5fa3..98b397e 100644 --- a/drivers/staging/lustre/lustre/include/obd_class.h +++ b/drivers/staging/lustre/lustre/include/obd_class.h @@ -75,8 +75,7 @@ struct lu_device_type; extern struct list_head obd_types; struct obd_export *class_conn2export(struct lustre_handle *); int class_register_type(struct obd_ops *, struct md_ops *, - struct lprocfs_vars *, const char *nm, - struct lu_device_type *ldt); + const char *nm, struct lu_device_type *ldt); int class_unregister_type(const char *nm); struct obd_device *class_newdev(const char *type_name, const char *name); diff --git a/drivers/staging/lustre/lustre/llite/lproc_llite.c b/drivers/staging/lustre/lustre/llite/lproc_llite.c index 49fbecc..e1fc620 100644 --- a/drivers/staging/lustre/lustre/llite/lproc_llite.c +++ b/drivers/staging/lustre/lustre/llite/lproc_llite.c @@ -1532,6 +1532,5 @@ LPROC_SEQ_FOPS(ll_rw_offset_stats); void lprocfs_llite_init_vars(struct lprocfs_static_vars *lvars) { - lvars->module_vars = NULL; lvars->obd_vars = lprocfs_llite_obd_vars; } diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c index 8e05852..0b2d35f 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c @@ -2873,7 +2873,7 @@ static int __init lmv_init(void) lprocfs_lmv_init_vars(&lvars); rc = class_register_type(&lmv_obd_ops, &lmv_md_ops, - lvars.module_vars, LUSTRE_LMV_NAME, NULL); + LUSTRE_LMV_NAME, NULL); return rc; } diff --git a/drivers/staging/lustre/lustre/lmv/lproc_lmv.c b/drivers/staging/lustre/lustre/lmv/lproc_lmv.c index 22e5c31..76b32d5 100644 --- a/drivers/staging/lustre/lustre/lmv/lproc_lmv.c +++ b/drivers/staging/lustre/lustre/lmv/lproc_lmv.c @@ -215,13 +215,6 @@ static struct lprocfs_vars lprocfs_lmv_obd_vars[] = { { NULL } }; -LPROC_SEQ_FOPS_RO_TYPE(lmv, numrefs); - -static struct lprocfs_vars lprocfs_lmv_module_vars[] = { - { "num_refs", &lmv_numrefs_fops, NULL, 0 }, - { NULL } -}; - struct file_operations lmv_proc_target_fops = { .owner = THIS_MODULE, .open = lmv_target_seq_open, @@ -232,6 +225,5 @@ struct file_operations lmv_proc_target_fops = { void lprocfs_lmv_init_vars(struct lprocfs_static_vars *lvars) { - lvars->module_vars = lprocfs_lmv_module_vars; lvars->obd_vars = lprocfs_lmv_obd_vars; } diff --git a/drivers/staging/lustre/lustre/lov/lov_obd.c b/drivers/staging/lustre/lustre/lov/lov_obd.c index 054ca32..d4e8d9c 100644 --- a/drivers/staging/lustre/lustre/lov/lov_obd.c +++ b/drivers/staging/lustre/lustre/lov/lov_obd.c @@ -2365,7 +2365,7 @@ static int __init lov_init(void) } lprocfs_lov_init_vars(&lvars); - rc = class_register_type(&lov_obd_ops, NULL, lvars.module_vars, + rc = class_register_type(&lov_obd_ops, NULL, LUSTRE_LOV_NAME, &lov_device_type); if (rc) { diff --git a/drivers/staging/lustre/lustre/lov/lproc_lov.c b/drivers/staging/lustre/lustre/lov/lproc_lov.c index 174cbf5..18fdd7e 100644 --- a/drivers/staging/lustre/lustre/lov/lproc_lov.c +++ b/drivers/staging/lustre/lustre/lov/lproc_lov.c @@ -289,16 +289,8 @@ static struct lprocfs_vars lprocfs_lov_obd_vars[] = { { NULL } }; -LPROC_SEQ_FOPS_RO_TYPE(lov, numrefs); - -static struct lprocfs_vars lprocfs_lov_module_vars[] = { - { "num_refs", &lov_numrefs_fops, NULL, 0 }, - { NULL } -}; - void lprocfs_lov_init_vars(struct lprocfs_static_vars *lvars) { - lvars->module_vars = lprocfs_lov_module_vars; lvars->obd_vars = lprocfs_lov_obd_vars; } diff --git a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c index 23d22a4..5c38cd7 100644 --- a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c +++ b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c @@ -206,15 +206,7 @@ static struct lprocfs_vars lprocfs_mdc_obd_vars[] = { { NULL } }; -LPROC_SEQ_FOPS_RO_TYPE(mdc, numrefs); - -static struct lprocfs_vars lprocfs_mdc_module_vars[] = { - { "num_refs", &mdc_numrefs_fops, NULL, 0 }, - { NULL } -}; - void lprocfs_mdc_init_vars(struct lprocfs_static_vars *lvars) { - lvars->module_vars = lprocfs_mdc_module_vars; lvars->obd_vars = lprocfs_mdc_obd_vars; } diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c index cbbdfce..b24ec3f 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_request.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c @@ -2713,7 +2713,7 @@ static int __init mdc_init(void) lprocfs_mdc_init_vars(&lvars); - return class_register_type(&mdc_obd_ops, &mdc_md_ops, lvars.module_vars, + return class_register_type(&mdc_obd_ops, &mdc_md_ops, LUSTRE_MDC_NAME, NULL); } diff --git a/drivers/staging/lustre/lustre/mgc/lproc_mgc.c b/drivers/staging/lustre/lustre/mgc/lproc_mgc.c index c4ea38e..ad889e7 100644 --- a/drivers/staging/lustre/lustre/mgc/lproc_mgc.c +++ b/drivers/staging/lustre/lustre/mgc/lproc_mgc.c @@ -67,14 +67,7 @@ static struct lprocfs_vars lprocfs_mgc_obd_vars[] = { { NULL } }; -LPROC_SEQ_FOPS_RO_TYPE(mgc, numrefs); -static struct lprocfs_vars lprocfs_mgc_module_vars[] = { - { "num_refs", &mgc_numrefs_fops, NULL, 0 }, - { NULL } -}; - void lprocfs_mgc_init_vars(struct lprocfs_static_vars *lvars) { - lvars->module_vars = lprocfs_mgc_module_vars; lvars->obd_vars = lprocfs_mgc_obd_vars; } diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c index f152e5c..5fff272 100644 --- a/drivers/staging/lustre/lustre/mgc/mgc_request.c +++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c @@ -1745,7 +1745,7 @@ struct obd_ops mgc_obd_ops = { static int __init mgc_init(void) { - return class_register_type(&mgc_obd_ops, NULL, NULL, + return class_register_type(&mgc_obd_ops, NULL, LUSTRE_MGC_NAME, NULL); } diff --git a/drivers/staging/lustre/lustre/obdclass/genops.c b/drivers/staging/lustre/lustre/obdclass/genops.c index 37d6aef..eab4130 100644 --- a/drivers/staging/lustre/lustre/obdclass/genops.c +++ b/drivers/staging/lustre/lustre/obdclass/genops.c @@ -156,7 +156,7 @@ EXPORT_SYMBOL(class_put_type); #define CLASS_MAX_NAME 1024 int class_register_type(struct obd_ops *dt_ops, struct md_ops *md_ops, - struct lprocfs_vars *vars, const char *name, + const char *name, struct lu_device_type *ldt) { struct obd_type *type; @@ -192,7 +192,7 @@ int class_register_type(struct obd_ops *dt_ops, struct md_ops *md_ops, spin_lock_init(&type->obd_type_lock); type->typ_procroot = lprocfs_register(type->typ_name, proc_lustre_root, - vars, type); + NULL, type); if (IS_ERR(type->typ_procroot)) { rc = PTR_ERR(type->typ_procroot); type->typ_procroot = NULL; diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c index 000e874..a91894d 100644 --- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c +++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c @@ -1004,16 +1004,6 @@ int lprocfs_rd_num_exports(struct seq_file *m, void *data) } EXPORT_SYMBOL(lprocfs_rd_num_exports); -int lprocfs_rd_numrefs(struct seq_file *m, void *data) -{ - struct obd_type *class = (struct obd_type *) data; - - LASSERT(class != NULL); - seq_printf(m, "%d\n", class->typ_refcnt); - return 0; -} -EXPORT_SYMBOL(lprocfs_rd_numrefs); - int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list) { int rc = 0; diff --git a/drivers/staging/lustre/lustre/obdecho/echo_client.c b/drivers/staging/lustre/lustre/obdecho/echo_client.c index 5376178..f9cfba1 100644 --- a/drivers/staging/lustre/lustre/obdecho/echo_client.c +++ b/drivers/staging/lustre/lustre/obdecho/echo_client.c @@ -2149,7 +2149,6 @@ int echo_client_init(void) rc = lu_kmem_init(echo_caches); if (rc == 0) { rc = class_register_type(&echo_client_obd_ops, NULL, - lvars.module_vars, LUSTRE_ECHO_CLIENT_NAME, &echo_device_type); if (rc) diff --git a/drivers/staging/lustre/lustre/obdecho/lproc_echo.c b/drivers/staging/lustre/lustre/obdecho/lproc_echo.c index 0beb97d..2eb702e 100644 --- a/drivers/staging/lustre/lustre/obdecho/lproc_echo.c +++ b/drivers/staging/lustre/lustre/obdecho/lproc_echo.c @@ -43,15 +43,8 @@ static struct lprocfs_vars lprocfs_echo_obd_vars[] = { { NULL } }; -LPROC_SEQ_FOPS_RO_TYPE(echo, numrefs); -static struct lprocfs_vars lprocfs_echo_module_vars[] = { - { "num_refs", &echo_numrefs_fops, NULL, 0 }, - { NULL } -}; - void lprocfs_echo_init_vars(struct lprocfs_static_vars *lvars) { - lvars->module_vars = lprocfs_echo_module_vars; lvars->obd_vars = lprocfs_echo_obd_vars; } #endif /* CONFIG_PROC_FS */ diff --git a/drivers/staging/lustre/lustre/osc/lproc_osc.c b/drivers/staging/lustre/lustre/osc/lproc_osc.c index 15a6620..93ad272 100644 --- a/drivers/staging/lustre/lustre/osc/lproc_osc.c +++ b/drivers/staging/lustre/lustre/osc/lproc_osc.c @@ -573,12 +573,6 @@ static struct lprocfs_vars lprocfs_osc_obd_vars[] = { { NULL } }; -LPROC_SEQ_FOPS_RO_TYPE(osc, numrefs); -static struct lprocfs_vars lprocfs_osc_module_vars[] = { - { "num_refs", &osc_numrefs_fops, NULL, 0 }, - { NULL } -}; - #define pct(a, b) (b ? a * 100 / b : 0) static int osc_rpc_stats_seq_show(struct seq_file *seq, void *v) @@ -746,6 +740,5 @@ int lproc_osc_attach_seqstat(struct obd_device *dev) void lprocfs_osc_init_vars(struct lprocfs_static_vars *lvars) { - lvars->module_vars = lprocfs_osc_module_vars; lvars->obd_vars = lprocfs_osc_obd_vars; } diff --git a/drivers/staging/lustre/lustre/osc/osc_request.c b/drivers/staging/lustre/lustre/osc/osc_request.c index ded184e..5924f9f 100644 --- a/drivers/staging/lustre/lustre/osc/osc_request.c +++ b/drivers/staging/lustre/lustre/osc/osc_request.c @@ -3351,7 +3351,7 @@ static int __init osc_init(void) lprocfs_osc_init_vars(&lvars); - rc = class_register_type(&osc_obd_ops, NULL, lvars.module_vars, + rc = class_register_type(&osc_obd_ops, NULL, LUSTRE_OSC_NAME, &osc_device_type); if (rc) { lu_kmem_fini(osc_caches); -- 2.7.4