staging/lustre: Remove useless num_refs procfs variable
authorOleg Drokin <green@linuxhacker.ru>
Thu, 21 May 2015 19:32:13 +0000 (15:32 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 31 May 2015 02:16:54 +0000 (11:16 +0900)
Every obd type registers it, but it's not really needed by anybody.
Remove all the supporting infrastructure too.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17 files changed:
drivers/staging/lustre/lustre/include/lprocfs_status.h
drivers/staging/lustre/lustre/include/obd_class.h
drivers/staging/lustre/lustre/llite/lproc_llite.c
drivers/staging/lustre/lustre/lmv/lmv_obd.c
drivers/staging/lustre/lustre/lmv/lproc_lmv.c
drivers/staging/lustre/lustre/lov/lov_obd.c
drivers/staging/lustre/lustre/lov/lproc_lov.c
drivers/staging/lustre/lustre/mdc/lproc_mdc.c
drivers/staging/lustre/lustre/mdc/mdc_request.c
drivers/staging/lustre/lustre/mgc/lproc_mgc.c
drivers/staging/lustre/lustre/mgc/mgc_request.c
drivers/staging/lustre/lustre/obdclass/genops.c
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
drivers/staging/lustre/lustre/obdecho/echo_client.c
drivers/staging/lustre/lustre/obdecho/lproc_echo.c
drivers/staging/lustre/lustre/osc/lproc_osc.c
drivers/staging/lustre/lustre/osc/osc_request.c

index 313f39436d09b962be954837a3746e1a952f2736..48a0d565b0cc59d479e273ebb3be71fa23e2b63e 100644 (file)
@@ -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,
index 34b5fa3f081ce3c2641a0b217b2d7b6fd10b1ca8..98b397e139a859d8732d558845da72de6b87098a 100644 (file)
@@ -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);
index 49fbecc40cac0fbacb7a90652d8982438f62a5f2..e1fc62084bb18590a1df86fe0f213161f991db77 100644 (file)
@@ -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;
 }
index 8e05852ea712faa6a8af69938fc9319697d5bfb0..0b2d35f26fc597301b73234752dcab2e461e4d92 100644 (file)
@@ -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;
 }
 
index 22e5c315faa42de69bf3cea27bc11c3546c7c262..76b32d56eb081cedc1ec1a993c08a60d3ffa1cdd 100644 (file)
@@ -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;
 }
index 054ca32099c826a71dbc2844a5ae69ec63255b18..d4e8d9c30ed3292c78ac743ba92ce81ea2a81ee3 100644 (file)
@@ -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) {
index 174cbf5c138f87f7be3591d288c32ef07d2805b9..18fdd7ec75c45b5590f28fd2def735e90f69228b 100644 (file)
@@ -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;
 }
 
index 23d22a4a606ecb063a88a3fae4a13a32315f83ac..5c38cd7c22e76f9ebe41db772cff12f25e7b718f 100644 (file)
@@ -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;
 }
index cbbdfceb9b2a92fd577903541f635d75d4502b31..b24ec3f848f3052a93b405c62fd4ae0b827006fe 100644 (file)
@@ -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);
 }
 
index c4ea38e5f07763dd3327d8bec54ae41326b89abe..ad889e71bd6c48f97bcdc23e988257fe5d8afb4e 100644 (file)
@@ -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;
 }
index f152e5ceb94192bb5467bfc1eacbe3b840ce5c00..5fff272f7b9f29a5f73af3d11c8aaf7f52633ab1 100644 (file)
@@ -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);
 }
 
index 37d6aefde5349cc921bac5b7d5dfccf056fc706c..eab4130d6c49986c392cbc81233f66c288b3f3c6 100644 (file)
@@ -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;
index 000e8748da4af32ed839477f8dc981e03310999a..a91894d93d4d953bf0d28438e14a512d4c668163 100644 (file)
@@ -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;
index 53761787a56f1219370e99654e8a74a3f71f7452..f9cfba17995f1e92d9f25ad8bc097d24f155bc0c 100644 (file)
@@ -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)
index 0beb97db7c7d9d377bee945139eccc242bd9bc52..2eb702e48c5738de26e6d143cc94efd5f668286f 100644 (file)
@@ -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 */
index 15a66209831c56b38beb5b3393b8c32f2b0c4e87..93ad272fe46dd294304ca7d5cfa9d46df50eb798 100644 (file)
@@ -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;
 }
index ded184edb50f75ee1b9af78202c9ece52ff5d220..5924f9f1b5b1801879d70ed64f96ad97b02156b3 100644 (file)
@@ -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);