Commit 2962b440 authored by Oleg Drokin's avatar Oleg Drokin Committed by Greg Kroah-Hartman

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: default avatarOleg Drokin <green@linuxhacker.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 77386b3c
...@@ -61,7 +61,6 @@ struct lprocfs_vars { ...@@ -61,7 +61,6 @@ struct lprocfs_vars {
}; };
struct lprocfs_static_vars { struct lprocfs_static_vars {
struct lprocfs_vars *module_vars;
struct lprocfs_vars *obd_vars; struct lprocfs_vars *obd_vars;
}; };
...@@ -640,7 +639,6 @@ extern int lprocfs_rd_import(struct seq_file *m, void *data); ...@@ -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_state(struct seq_file *m, void *data);
extern int lprocfs_rd_connect_flags(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_num_exports(struct seq_file *m, void *data);
extern int lprocfs_rd_numrefs(struct seq_file *m, void *data);
struct adaptive_timeout; struct adaptive_timeout;
extern int lprocfs_at_hist_helper(struct seq_file *m, extern int lprocfs_at_hist_helper(struct seq_file *m,
......
...@@ -75,8 +75,7 @@ struct lu_device_type; ...@@ -75,8 +75,7 @@ struct lu_device_type;
extern struct list_head obd_types; extern struct list_head obd_types;
struct obd_export *class_conn2export(struct lustre_handle *); struct obd_export *class_conn2export(struct lustre_handle *);
int class_register_type(struct obd_ops *, struct md_ops *, int class_register_type(struct obd_ops *, struct md_ops *,
struct lprocfs_vars *, const char *nm, const char *nm, struct lu_device_type *ldt);
struct lu_device_type *ldt);
int class_unregister_type(const char *nm); int class_unregister_type(const char *nm);
struct obd_device *class_newdev(const char *type_name, const char *name); struct obd_device *class_newdev(const char *type_name, const char *name);
......
...@@ -1532,6 +1532,5 @@ LPROC_SEQ_FOPS(ll_rw_offset_stats); ...@@ -1532,6 +1532,5 @@ LPROC_SEQ_FOPS(ll_rw_offset_stats);
void lprocfs_llite_init_vars(struct lprocfs_static_vars *lvars) void lprocfs_llite_init_vars(struct lprocfs_static_vars *lvars)
{ {
lvars->module_vars = NULL;
lvars->obd_vars = lprocfs_llite_obd_vars; lvars->obd_vars = lprocfs_llite_obd_vars;
} }
...@@ -2873,7 +2873,7 @@ static int __init lmv_init(void) ...@@ -2873,7 +2873,7 @@ static int __init lmv_init(void)
lprocfs_lmv_init_vars(&lvars); lprocfs_lmv_init_vars(&lvars);
rc = class_register_type(&lmv_obd_ops, &lmv_md_ops, rc = class_register_type(&lmv_obd_ops, &lmv_md_ops,
lvars.module_vars, LUSTRE_LMV_NAME, NULL); LUSTRE_LMV_NAME, NULL);
return rc; return rc;
} }
......
...@@ -215,13 +215,6 @@ static struct lprocfs_vars lprocfs_lmv_obd_vars[] = { ...@@ -215,13 +215,6 @@ static struct lprocfs_vars lprocfs_lmv_obd_vars[] = {
{ NULL } { 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 = { struct file_operations lmv_proc_target_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = lmv_target_seq_open, .open = lmv_target_seq_open,
...@@ -232,6 +225,5 @@ struct file_operations lmv_proc_target_fops = { ...@@ -232,6 +225,5 @@ struct file_operations lmv_proc_target_fops = {
void lprocfs_lmv_init_vars(struct lprocfs_static_vars *lvars) void lprocfs_lmv_init_vars(struct lprocfs_static_vars *lvars)
{ {
lvars->module_vars = lprocfs_lmv_module_vars;
lvars->obd_vars = lprocfs_lmv_obd_vars; lvars->obd_vars = lprocfs_lmv_obd_vars;
} }
...@@ -2365,7 +2365,7 @@ static int __init lov_init(void) ...@@ -2365,7 +2365,7 @@ static int __init lov_init(void)
} }
lprocfs_lov_init_vars(&lvars); 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); LUSTRE_LOV_NAME, &lov_device_type);
if (rc) { if (rc) {
......
...@@ -289,16 +289,8 @@ static struct lprocfs_vars lprocfs_lov_obd_vars[] = { ...@@ -289,16 +289,8 @@ static struct lprocfs_vars lprocfs_lov_obd_vars[] = {
{ NULL } { 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) void lprocfs_lov_init_vars(struct lprocfs_static_vars *lvars)
{ {
lvars->module_vars = lprocfs_lov_module_vars;
lvars->obd_vars = lprocfs_lov_obd_vars; lvars->obd_vars = lprocfs_lov_obd_vars;
} }
......
...@@ -206,15 +206,7 @@ static struct lprocfs_vars lprocfs_mdc_obd_vars[] = { ...@@ -206,15 +206,7 @@ static struct lprocfs_vars lprocfs_mdc_obd_vars[] = {
{ NULL } { 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) void lprocfs_mdc_init_vars(struct lprocfs_static_vars *lvars)
{ {
lvars->module_vars = lprocfs_mdc_module_vars;
lvars->obd_vars = lprocfs_mdc_obd_vars; lvars->obd_vars = lprocfs_mdc_obd_vars;
} }
...@@ -2713,7 +2713,7 @@ static int __init mdc_init(void) ...@@ -2713,7 +2713,7 @@ static int __init mdc_init(void)
lprocfs_mdc_init_vars(&lvars); 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); LUSTRE_MDC_NAME, NULL);
} }
......
...@@ -67,14 +67,7 @@ static struct lprocfs_vars lprocfs_mgc_obd_vars[] = { ...@@ -67,14 +67,7 @@ static struct lprocfs_vars lprocfs_mgc_obd_vars[] = {
{ NULL } { 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) void lprocfs_mgc_init_vars(struct lprocfs_static_vars *lvars)
{ {
lvars->module_vars = lprocfs_mgc_module_vars;
lvars->obd_vars = lprocfs_mgc_obd_vars; lvars->obd_vars = lprocfs_mgc_obd_vars;
} }
...@@ -1745,7 +1745,7 @@ struct obd_ops mgc_obd_ops = { ...@@ -1745,7 +1745,7 @@ struct obd_ops mgc_obd_ops = {
static int __init mgc_init(void) 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); LUSTRE_MGC_NAME, NULL);
} }
......
...@@ -156,7 +156,7 @@ EXPORT_SYMBOL(class_put_type); ...@@ -156,7 +156,7 @@ EXPORT_SYMBOL(class_put_type);
#define CLASS_MAX_NAME 1024 #define CLASS_MAX_NAME 1024
int class_register_type(struct obd_ops *dt_ops, struct md_ops *md_ops, 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 lu_device_type *ldt)
{ {
struct obd_type *type; struct obd_type *type;
...@@ -192,7 +192,7 @@ int class_register_type(struct obd_ops *dt_ops, struct md_ops *md_ops, ...@@ -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); spin_lock_init(&type->obd_type_lock);
type->typ_procroot = lprocfs_register(type->typ_name, proc_lustre_root, type->typ_procroot = lprocfs_register(type->typ_name, proc_lustre_root,
vars, type); NULL, type);
if (IS_ERR(type->typ_procroot)) { if (IS_ERR(type->typ_procroot)) {
rc = PTR_ERR(type->typ_procroot); rc = PTR_ERR(type->typ_procroot);
type->typ_procroot = NULL; type->typ_procroot = NULL;
......
...@@ -1004,16 +1004,6 @@ int lprocfs_rd_num_exports(struct seq_file *m, void *data) ...@@ -1004,16 +1004,6 @@ int lprocfs_rd_num_exports(struct seq_file *m, void *data)
} }
EXPORT_SYMBOL(lprocfs_rd_num_exports); 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 lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list)
{ {
int rc = 0; int rc = 0;
......
...@@ -2149,7 +2149,6 @@ int echo_client_init(void) ...@@ -2149,7 +2149,6 @@ int echo_client_init(void)
rc = lu_kmem_init(echo_caches); rc = lu_kmem_init(echo_caches);
if (rc == 0) { if (rc == 0) {
rc = class_register_type(&echo_client_obd_ops, NULL, rc = class_register_type(&echo_client_obd_ops, NULL,
lvars.module_vars,
LUSTRE_ECHO_CLIENT_NAME, LUSTRE_ECHO_CLIENT_NAME,
&echo_device_type); &echo_device_type);
if (rc) if (rc)
......
...@@ -43,15 +43,8 @@ static struct lprocfs_vars lprocfs_echo_obd_vars[] = { ...@@ -43,15 +43,8 @@ static struct lprocfs_vars lprocfs_echo_obd_vars[] = {
{ NULL } { 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) void lprocfs_echo_init_vars(struct lprocfs_static_vars *lvars)
{ {
lvars->module_vars = lprocfs_echo_module_vars;
lvars->obd_vars = lprocfs_echo_obd_vars; lvars->obd_vars = lprocfs_echo_obd_vars;
} }
#endif /* CONFIG_PROC_FS */ #endif /* CONFIG_PROC_FS */
...@@ -573,12 +573,6 @@ static struct lprocfs_vars lprocfs_osc_obd_vars[] = { ...@@ -573,12 +573,6 @@ static struct lprocfs_vars lprocfs_osc_obd_vars[] = {
{ NULL } { 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) #define pct(a, b) (b ? a * 100 / b : 0)
static int osc_rpc_stats_seq_show(struct seq_file *seq, void *v) 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) ...@@ -746,6 +740,5 @@ int lproc_osc_attach_seqstat(struct obd_device *dev)
void lprocfs_osc_init_vars(struct lprocfs_static_vars *lvars) void lprocfs_osc_init_vars(struct lprocfs_static_vars *lvars)
{ {
lvars->module_vars = lprocfs_osc_module_vars;
lvars->obd_vars = lprocfs_osc_obd_vars; lvars->obd_vars = lprocfs_osc_obd_vars;
} }
...@@ -3351,7 +3351,7 @@ static int __init osc_init(void) ...@@ -3351,7 +3351,7 @@ static int __init osc_init(void)
lprocfs_osc_init_vars(&lvars); 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); LUSTRE_OSC_NAME, &osc_device_type);
if (rc) { if (rc) {
lu_kmem_fini(osc_caches); lu_kmem_fini(osc_caches);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment