const char *units);
struct obd_export;
int lprocfs_exp_cleanup(struct obd_export *exp);
-int ldebugfs_register_stats(struct dentry *parent,
- const char *name,
- struct lprocfs_stats *stats);
+extern const struct file_operations lprocfs_stats_seq_fops;
/* lprocfs_status.c */
int ldebugfs_add_vars(struct dentry *parent,
lprocfs_counter_init(pl->pl_stats, LDLM_POOL_TIMING_STAT,
LPROCFS_CNTR_AVGMINMAX | LPROCFS_CNTR_STDDEV,
"recalc_timing", "sec");
- rc = ldebugfs_register_stats(pl->pl_debugfs_entry, "stats",
- pl->pl_stats);
+ debugfs_create_file("stats", 0644, pl->pl_debugfs_entry, pl->pl_stats,
+ &lprocfs_stats_seq_fops);
out_free_name:
kfree(var_name);
(type & LPROCFS_CNTR_AVGMINMAX),
llite_opcode_table[id].opname, ptr);
}
- err = ldebugfs_register_stats(sbi->ll_debugfs_entry, "stats",
- sbi->ll_stats);
- if (err)
- goto out;
+
+ 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),
LPROCFS_STATS_FLAG_NONE);
lprocfs_counter_init(sbi->ll_ra_stats, id, 0,
ra_stat_string[id], "pages");
- err = ldebugfs_register_stats(sbi->ll_debugfs_entry, "read_ahead_stats",
- sbi->ll_ra_stats);
- if (err)
- goto out;
+ debugfs_create_file("stats", 0644, sbi->ll_debugfs_entry,
+ sbi->ll_ra_stats, &lprocfs_stats_seq_fops);
err = ldebugfs_add_vars(sbi->ll_debugfs_entry,
lprocfs_llite_obd_vars, sb);
return 0;
}
-static const struct file_operations lprocfs_stats_seq_fops = {
+const struct file_operations lprocfs_stats_seq_fops = {
.owner = THIS_MODULE,
.open = lprocfs_stats_seq_open,
.read = seq_read,
.llseek = seq_lseek,
.release = lprocfs_seq_release,
};
-
-int ldebugfs_register_stats(struct dentry *parent, const char *name,
- struct lprocfs_stats *stats)
-{
- struct dentry *entry;
-
- LASSERT(!IS_ERR_OR_NULL(parent));
-
- entry = debugfs_create_file(name, 0644, parent, stats,
- &lprocfs_stats_seq_fops);
- return 0;
-}
-EXPORT_SYMBOL_GPL(ldebugfs_register_stats);
+EXPORT_SYMBOL_GPL(lprocfs_stats_seq_fops);
void lprocfs_counter_init(struct lprocfs_stats *stats, int index,
unsigned int conf, const char *name,
{
struct dentry *svc_debugfs_entry;
struct lprocfs_stats *svc_stats;
- int i, rc;
+ int i;
unsigned int svc_counter_config = LPROCFS_CNTR_AVGMINMAX |
LPROCFS_CNTR_STDDEV;
ll_opcode2str(opcode), "usec");
}
- rc = ldebugfs_register_stats(svc_debugfs_entry, name, svc_stats);
- if (rc < 0) {
- if (dir)
- ldebugfs_remove(&svc_debugfs_entry);
- lprocfs_free_stats(&svc_stats);
- } else {
- if (dir)
- *debugfs_root_ret = svc_debugfs_entry;
- *stats_ret = svc_stats;
- }
+ debugfs_create_file("stats", 0644, svc_debugfs_entry, svc_stats,
+ &lprocfs_stats_seq_fops);
+ if (dir)
+ *debugfs_root_ret = svc_debugfs_entry;
+ *stats_ret = svc_stats;
}
static int