staging/lustre: Remove unused lprocfs_alloc/free_md_stats
This code is not called anywhere in the current client code, so we can remove it. Also remove a helper function lprocfs_init_mps_stats Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
9a6198c74d
commit
cf16e3718c
@ -539,13 +539,9 @@ extern struct lprocfs_stats *
|
|||||||
lprocfs_alloc_stats(unsigned int num, enum lprocfs_stats_flags flags);
|
lprocfs_alloc_stats(unsigned int num, enum lprocfs_stats_flags flags);
|
||||||
void lprocfs_clear_stats(struct lprocfs_stats *stats);
|
void lprocfs_clear_stats(struct lprocfs_stats *stats);
|
||||||
void lprocfs_free_stats(struct lprocfs_stats **stats);
|
void lprocfs_free_stats(struct lprocfs_stats **stats);
|
||||||
void lprocfs_init_mps_stats(int num_private_stats, struct lprocfs_stats *stats);
|
|
||||||
void lprocfs_init_ldlm_stats(struct lprocfs_stats *ldlm_stats);
|
void lprocfs_init_ldlm_stats(struct lprocfs_stats *ldlm_stats);
|
||||||
int lprocfs_alloc_md_stats(struct obd_device *obddev,
|
|
||||||
unsigned int num_private_stats);
|
|
||||||
void lprocfs_counter_init(struct lprocfs_stats *stats, int index,
|
void lprocfs_counter_init(struct lprocfs_stats *stats, int index,
|
||||||
unsigned conf, const char *name, const char *units);
|
unsigned conf, const char *name, const char *units);
|
||||||
void lprocfs_free_md_stats(struct obd_device *obddev);
|
|
||||||
struct obd_export;
|
struct obd_export;
|
||||||
int lprocfs_exp_cleanup(struct obd_export *exp);
|
int lprocfs_exp_cleanup(struct obd_export *exp);
|
||||||
struct dentry *ldebugfs_add_simple(struct dentry *root,
|
struct dentry *ldebugfs_add_simple(struct dentry *root,
|
||||||
|
@ -1300,99 +1300,6 @@ void lprocfs_counter_init(struct lprocfs_stats *stats, int index,
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL(lprocfs_counter_init);
|
EXPORT_SYMBOL(lprocfs_counter_init);
|
||||||
|
|
||||||
#define LPROCFS_MD_OP_INIT(base, stats, op) \
|
|
||||||
do { \
|
|
||||||
unsigned int coffset = base + MD_COUNTER_OFFSET(op); \
|
|
||||||
LASSERT(coffset < stats->ls_num); \
|
|
||||||
lprocfs_counter_init(stats, coffset, 0, #op, "reqs"); \
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
void lprocfs_init_mps_stats(int num_private_stats, struct lprocfs_stats *stats)
|
|
||||||
{
|
|
||||||
LPROCFS_MD_OP_INIT(num_private_stats, stats, getstatus);
|
|
||||||
LPROCFS_MD_OP_INIT(num_private_stats, stats, null_inode);
|
|
||||||
LPROCFS_MD_OP_INIT(num_private_stats, stats, find_cbdata);
|
|
||||||
LPROCFS_MD_OP_INIT(num_private_stats, stats, close);
|
|
||||||
LPROCFS_MD_OP_INIT(num_private_stats, stats, create);
|
|
||||||
LPROCFS_MD_OP_INIT(num_private_stats, stats, done_writing);
|
|
||||||
LPROCFS_MD_OP_INIT(num_private_stats, stats, enqueue);
|
|
||||||
LPROCFS_MD_OP_INIT(num_private_stats, stats, getattr);
|
|
||||||
LPROCFS_MD_OP_INIT(num_private_stats, stats, getattr_name);
|
|
||||||
LPROCFS_MD_OP_INIT(num_private_stats, stats, intent_lock);
|
|
||||||
LPROCFS_MD_OP_INIT(num_private_stats, stats, link);
|
|
||||||
LPROCFS_MD_OP_INIT(num_private_stats, stats, rename);
|
|
||||||
LPROCFS_MD_OP_INIT(num_private_stats, stats, is_subdir);
|
|
||||||
LPROCFS_MD_OP_INIT(num_private_stats, stats, setattr);
|
|
||||||
LPROCFS_MD_OP_INIT(num_private_stats, stats, sync);
|
|
||||||
LPROCFS_MD_OP_INIT(num_private_stats, stats, readpage);
|
|
||||||
LPROCFS_MD_OP_INIT(num_private_stats, stats, unlink);
|
|
||||||
LPROCFS_MD_OP_INIT(num_private_stats, stats, setxattr);
|
|
||||||
LPROCFS_MD_OP_INIT(num_private_stats, stats, getxattr);
|
|
||||||
LPROCFS_MD_OP_INIT(num_private_stats, stats, init_ea_size);
|
|
||||||
LPROCFS_MD_OP_INIT(num_private_stats, stats, get_lustre_md);
|
|
||||||
LPROCFS_MD_OP_INIT(num_private_stats, stats, free_lustre_md);
|
|
||||||
LPROCFS_MD_OP_INIT(num_private_stats, stats, set_open_replay_data);
|
|
||||||
LPROCFS_MD_OP_INIT(num_private_stats, stats, clear_open_replay_data);
|
|
||||||
LPROCFS_MD_OP_INIT(num_private_stats, stats, set_lock_data);
|
|
||||||
LPROCFS_MD_OP_INIT(num_private_stats, stats, lock_match);
|
|
||||||
LPROCFS_MD_OP_INIT(num_private_stats, stats, cancel_unused);
|
|
||||||
LPROCFS_MD_OP_INIT(num_private_stats, stats, renew_capa);
|
|
||||||
LPROCFS_MD_OP_INIT(num_private_stats, stats, unpack_capa);
|
|
||||||
LPROCFS_MD_OP_INIT(num_private_stats, stats, get_remote_perm);
|
|
||||||
LPROCFS_MD_OP_INIT(num_private_stats, stats, intent_getattr_async);
|
|
||||||
LPROCFS_MD_OP_INIT(num_private_stats, stats, revalidate_lock);
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(lprocfs_init_mps_stats);
|
|
||||||
|
|
||||||
int lprocfs_alloc_md_stats(struct obd_device *obd,
|
|
||||||
unsigned num_private_stats)
|
|
||||||
{
|
|
||||||
struct lprocfs_stats *stats;
|
|
||||||
unsigned int num_stats;
|
|
||||||
int rc, i;
|
|
||||||
|
|
||||||
LASSERT(obd->md_stats == NULL);
|
|
||||||
LASSERT(obd->obd_debugfs_entry != NULL);
|
|
||||||
LASSERT(obd->md_cntr_base == 0);
|
|
||||||
|
|
||||||
num_stats = 1 + MD_COUNTER_OFFSET(revalidate_lock) +
|
|
||||||
num_private_stats;
|
|
||||||
stats = lprocfs_alloc_stats(num_stats, 0);
|
|
||||||
if (stats == NULL)
|
|
||||||
return -ENOMEM;
|
|
||||||
|
|
||||||
lprocfs_init_mps_stats(num_private_stats, stats);
|
|
||||||
|
|
||||||
for (i = num_private_stats; i < num_stats; i++) {
|
|
||||||
if (stats->ls_cnt_header[i].lc_name == NULL) {
|
|
||||||
CERROR("Missing md_stat initializer md_op operation at offset %d. Aborting.\n",
|
|
||||||
i - num_private_stats);
|
|
||||||
LBUG();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
rc = ldebugfs_register_stats(obd->obd_debugfs_entry, "md_stats", stats);
|
|
||||||
if (rc < 0) {
|
|
||||||
lprocfs_free_stats(&stats);
|
|
||||||
} else {
|
|
||||||
obd->md_stats = stats;
|
|
||||||
obd->md_cntr_base = num_private_stats;
|
|
||||||
}
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(lprocfs_alloc_md_stats);
|
|
||||||
|
|
||||||
void lprocfs_free_md_stats(struct obd_device *obd)
|
|
||||||
{
|
|
||||||
struct lprocfs_stats *stats = obd->md_stats;
|
|
||||||
|
|
||||||
if (stats != NULL) {
|
|
||||||
obd->md_stats = NULL;
|
|
||||||
obd->md_cntr_base = 0;
|
|
||||||
lprocfs_free_stats(&stats);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(lprocfs_free_md_stats);
|
|
||||||
|
|
||||||
void lprocfs_init_ldlm_stats(struct lprocfs_stats *ldlm_stats)
|
void lprocfs_init_ldlm_stats(struct lprocfs_stats *ldlm_stats)
|
||||||
{
|
{
|
||||||
lprocfs_counter_init(ldlm_stats,
|
lprocfs_counter_init(ldlm_stats,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user