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 ++-- .../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 313f39436d09..48a0d565b0cc 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 34b5fa3f081c..98b397e139a8 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 49fbecc40cac..e1fc62084bb1 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 8e05852ea712..0b2d35f26fc5 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 22e5c315faa4..76b32d56eb08 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 054ca32099c8..d4e8d9c30ed3 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 174cbf5c138f..18fdd7ec75c4 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 23d22a4a606e..5c38cd7c22e7 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 cbbdfceb9b2a..b24ec3f848f3 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 c4ea38e5f077..ad889e71bd6c 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 f152e5ceb941..5fff272f7b9f 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 37d6aefde534..eab4130d6c49 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 000e8748da4a..a91894d93d4d 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 53761787a56f..f9cfba17995f 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 0beb97db7c7d..2eb702e48c57 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 15a66209831c..93ad272fe46d 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 ded184edb50f..5924f9f1b5b1 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.30.2