@@ -439,9 +439,9 @@ u64 lprocfs_stats_collector(struct lprocfs_stats *stats, int idx,
enum lprocfs_fields_flags field);
extern struct lprocfs_stats *
-lprocfs_alloc_stats(unsigned int num, enum lprocfs_stats_flags flags);
-void lprocfs_clear_stats(struct lprocfs_stats *stats);
-void lprocfs_free_stats(struct lprocfs_stats **stats);
+lprocfs_stats_alloc(unsigned int num, enum lprocfs_stats_flags flags);
+void lprocfs_stats_clear(struct lprocfs_stats *stats);
+void lprocfs_stats_free(struct lprocfs_stats **stats);
int ldebugfs_alloc_md_stats(struct obd_device *obd,
unsigned int num_private_stats);
void ldebugfs_free_md_stats(struct obd_device *obd);
@@ -597,7 +597,7 @@ static int ldlm_pool_debugfs_init(struct ldlm_pool *pl)
ldlm_add_var(&pool_vars[0], pl->pl_debugfs_entry, "state", pl,
&lprocfs_pool_state_fops);
- pl->pl_stats = lprocfs_alloc_stats(LDLM_POOL_LAST_STAT -
+ pl->pl_stats = lprocfs_stats_alloc(LDLM_POOL_LAST_STAT -
LDLM_POOL_FIRST_STAT, 0);
if (!pl->pl_stats) {
rc = -ENOMEM;
@@ -652,7 +652,7 @@ static void ldlm_pool_sysfs_fini(struct ldlm_pool *pl)
static void ldlm_pool_debugfs_fini(struct ldlm_pool *pl)
{
if (pl->pl_stats) {
- lprocfs_free_stats(&pl->pl_stats);
+ lprocfs_stats_free(&pl->pl_stats);
pl->pl_stats = NULL;
}
debugfs_remove_recursive(pl->pl_debugfs_entry);
@@ -430,7 +430,7 @@ static void ldlm_namespace_debugfs_unregister(struct ldlm_namespace *ns)
debugfs_remove_recursive(ns->ns_debugfs_entry);
if (ns->ns_stats)
- lprocfs_free_stats(&ns->ns_stats);
+ lprocfs_stats_free(&ns->ns_stats);
}
static void ldlm_namespace_sysfs_unregister(struct ldlm_namespace *ns)
@@ -448,7 +448,7 @@ static int ldlm_namespace_sysfs_register(struct ldlm_namespace *ns)
err = kobject_init_and_add(&ns->ns_kobj, &ldlm_ns_ktype, NULL,
"%s", ldlm_ns_name(ns));
- ns->ns_stats = lprocfs_alloc_stats(LDLM_NSS_LAST, 0);
+ ns->ns_stats = lprocfs_stats_alloc(LDLM_NSS_LAST, 0);
if (!ns->ns_stats) {
kobject_put(&ns->ns_kobj);
return -ENOMEM;
@@ -680,7 +680,7 @@ static ssize_t ll_wr_track_id(struct kobject *kobj, const char *buffer,
sbi->ll_stats_track_type = STATS_TRACK_ALL;
else
sbi->ll_stats_track_type = type;
- lprocfs_clear_stats(sbi->ll_stats);
+ lprocfs_stats_clear(sbi->ll_stats);
return count;
}
@@ -1885,7 +1885,7 @@ int ll_debugfs_register_super(struct super_block *sb, const char *name)
&ll_rw_offset_stats_fops);
/* File operations stats */
- sbi->ll_stats = lprocfs_alloc_stats(LPROC_LL_FILE_OPCODES,
+ sbi->ll_stats = lprocfs_stats_alloc(LPROC_LL_FILE_OPCODES,
LPROCFS_STATS_FLAG_NONE);
if (!sbi->ll_stats) {
err = -ENOMEM;
@@ -1902,7 +1902,7 @@ int ll_debugfs_register_super(struct super_block *sb, const char *name)
debugfs_create_file("stats", 0644, sbi->ll_debugfs_entry, sbi->ll_stats,
&lprocfs_stats_seq_fops);
- sbi->ll_ra_stats = lprocfs_alloc_stats(ARRAY_SIZE(ra_stat_string),
+ sbi->ll_ra_stats = lprocfs_stats_alloc(ARRAY_SIZE(ra_stat_string),
LPROCFS_STATS_FLAG_NONE);
if (!sbi->ll_ra_stats) {
err = -ENOMEM;
@@ -1933,9 +1933,9 @@ int ll_debugfs_register_super(struct super_block *sb, const char *name)
return 0;
out_ra_stats:
- lprocfs_free_stats(&sbi->ll_ra_stats);
+ lprocfs_stats_free(&sbi->ll_ra_stats);
out_stats:
- lprocfs_free_stats(&sbi->ll_stats);
+ lprocfs_stats_free(&sbi->ll_stats);
out_debugfs:
debugfs_remove_recursive(sbi->ll_debugfs_entry);
@@ -1962,8 +1962,8 @@ void ll_debugfs_unregister_super(struct super_block *sb)
kset_unregister(&sbi->ll_kset);
wait_for_completion(&sbi->ll_kobj_unregister);
- lprocfs_free_stats(&sbi->ll_ra_stats);
- lprocfs_free_stats(&sbi->ll_stats);
+ lprocfs_stats_free(&sbi->ll_ra_stats);
+ lprocfs_stats_free(&sbi->ll_stats);
}
static void ll_display_extents_info(struct ll_rw_extents_info *rw_extents,
@@ -1205,7 +1205,7 @@ int lprocfs_stats_alloc_one(struct lprocfs_stats *stats, unsigned int cpuid)
return rc;
}
-struct lprocfs_stats *lprocfs_alloc_stats(unsigned int num,
+struct lprocfs_stats *lprocfs_stats_alloc(unsigned int num,
enum lprocfs_stats_flags flags)
{
struct lprocfs_stats *stats;
@@ -1259,12 +1259,12 @@ struct lprocfs_stats *lprocfs_alloc_stats(unsigned int num,
return stats;
fail:
- lprocfs_free_stats(&stats);
+ lprocfs_stats_free(&stats);
return NULL;
}
-EXPORT_SYMBOL(lprocfs_alloc_stats);
+EXPORT_SYMBOL(lprocfs_stats_alloc);
-void lprocfs_free_stats(struct lprocfs_stats **statsh)
+void lprocfs_stats_free(struct lprocfs_stats **statsh)
{
struct lprocfs_stats *stats = *statsh;
unsigned int num_entry;
@@ -1286,7 +1286,7 @@ void lprocfs_free_stats(struct lprocfs_stats **statsh)
kvfree(stats->ls_cnt_header);
kvfree(stats);
}
-EXPORT_SYMBOL(lprocfs_free_stats);
+EXPORT_SYMBOL(lprocfs_stats_free);
u64 lprocfs_stats_collector(struct lprocfs_stats *stats, int idx,
enum lprocfs_fields_flags field)
@@ -1312,12 +1312,12 @@ u64 lprocfs_stats_collector(struct lprocfs_stats *stats, int idx,
}
EXPORT_SYMBOL(lprocfs_stats_collector);
-void lprocfs_clear_stats(struct lprocfs_stats *stats)
+void lprocfs_stats_clear(struct lprocfs_stats *stats)
{
struct lprocfs_counter *percpu_cntr;
- int i, j;
unsigned int num_entry;
unsigned long flags = 0;
+ int i, j;
num_entry = lprocfs_stats_lock(stats, LPROCFS_GET_NUM_CPU, &flags);
@@ -1347,7 +1347,7 @@ void lprocfs_clear_stats(struct lprocfs_stats *stats)
lprocfs_stats_unlock(stats, LPROCFS_GET_NUM_CPU, &flags);
}
-EXPORT_SYMBOL(lprocfs_clear_stats);
+EXPORT_SYMBOL(lprocfs_stats_clear);
static ssize_t lprocfs_stats_seq_write(struct file *file,
const char __user *buf,
@@ -1356,7 +1356,7 @@ static ssize_t lprocfs_stats_seq_write(struct file *file,
struct seq_file *seq = file->private_data;
struct lprocfs_stats *stats = seq->private;
- lprocfs_clear_stats(stats);
+ lprocfs_stats_clear(stats);
return len;
}
@@ -1601,7 +1601,7 @@ int ldebugfs_alloc_md_stats(struct obd_device *obd,
return -EINVAL;
num_stats = ARRAY_SIZE(mps_stats) + num_private_stats;
- stats = lprocfs_alloc_stats(num_stats, 0);
+ stats = lprocfs_stats_alloc(num_stats, 0);
if (!stats)
return -ENOMEM;
@@ -1630,7 +1630,7 @@ void ldebugfs_free_md_stats(struct obd_device *obd)
return;
obd->obd_md_stats = NULL;
- lprocfs_free_stats(&stats);
+ lprocfs_stats_free(&stats);
}
EXPORT_SYMBOL(ldebugfs_free_md_stats);
@@ -1091,7 +1091,7 @@ int lu_site_init(struct lu_site *s, struct lu_device *top)
init_waitqueue_head(&bkt->lsb_waitq);
}
- s->ls_stats = lprocfs_alloc_stats(LU_SS_LAST_STAT, 0);
+ s->ls_stats = lprocfs_stats_alloc(LU_SS_LAST_STAT, 0);
if (!s->ls_stats) {
kvfree(s->ls_bkts);
s->ls_bkts = NULL;
@@ -1147,7 +1147,7 @@ void lu_site_fini(struct lu_site *s)
}
if (s->ls_stats)
- lprocfs_free_stats(&s->ls_stats);
+ lprocfs_stats_free(&s->ls_stats);
}
EXPORT_SYMBOL(lu_site_fini);
@@ -1163,6 +1163,7 @@ int lu_site_init_finish(struct lu_site *s)
if (result == 0)
list_add(&s->ls_linkage, &lu_sites);
up_write(&lu_sites_guard);
+
return result;
}
EXPORT_SYMBOL(lu_site_init_finish);
@@ -198,7 +198,7 @@ ptlrpc_ldebugfs_register(struct dentry *root, char *dir,
LASSERT(!*debugfs_root_ret);
LASSERT(!*stats_ret);
- svc_stats = lprocfs_alloc_stats(EXTRA_MAX_OPCODES + LUSTRE_MAX_OPCODES,
+ svc_stats = lprocfs_stats_alloc(EXTRA_MAX_OPCODES + LUSTRE_MAX_OPCODES,
0);
if (!svc_stats)
return;
@@ -1257,7 +1257,7 @@ void ptlrpc_lprocfs_unregister_service(struct ptlrpc_service *svc)
debugfs_remove_recursive(svc->srv_debugfs_entry);
if (svc->srv_stats)
- lprocfs_free_stats(&svc->srv_stats);
+ lprocfs_stats_free(&svc->srv_stats);
}
void ptlrpc_lprocfs_unregister_obd(struct obd_device *obd)
@@ -1269,7 +1269,7 @@ void ptlrpc_lprocfs_unregister_obd(struct obd_device *obd)
debugfs_remove_recursive(obd->obd_svc_debugfs_entry);
if (obd->obd_svc_stats)
- lprocfs_free_stats(&obd->obd_svc_stats);
+ lprocfs_stats_free(&obd->obd_svc_stats);
}
EXPORT_SYMBOL(ptlrpc_lprocfs_unregister_obd);