From be69837105edc20cfade1f25e8f3fb5c39b2e216 Mon Sep 17 00:00:00 2001 From: LiuYing Date: Fri, 12 Nov 2010 09:06:06 +0800 Subject: [PATCH] b=21420 fix aggregate mdt stats mdt_counter_incr() should act upon obd->md_stats instead of obd->obd_stats, the former is for recording md ops, while the later for obd ops. o=bobijam i=andreas i=liuying --- lustre/mdt/mdt_lproc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lustre/mdt/mdt_lproc.c b/lustre/mdt/mdt_lproc.c index 24932d9..534b268 100644 --- a/lustre/mdt/mdt_lproc.c +++ b/lustre/mdt/mdt_lproc.c @@ -112,6 +112,8 @@ int mdt_procfs_init(struct mdt_device *mdt, const char *name) "clear", lprocfs_nid_stats_clear_read, lprocfs_nid_stats_clear_write, obd, NULL); rc = lprocfs_alloc_md_stats(obd, LPROC_MDT_LAST); + if (rc == 0) + mdt_stats_counter_init(obd->md_stats); RETURN(rc); } @@ -813,8 +815,8 @@ void lprocfs_mdt_init_vars(struct lprocfs_static_vars *lvars) void mdt_counter_incr(struct obd_export *exp, int opcode) { - if (exp->exp_obd && exp->exp_obd->obd_stats) - lprocfs_counter_incr(exp->exp_obd->obd_stats, opcode); + if (exp->exp_obd && exp->exp_obd->md_stats) + lprocfs_counter_incr(exp->exp_obd->md_stats, opcode); if (exp->exp_nid_stats && exp->exp_nid_stats->nid_stats != NULL) lprocfs_counter_incr(exp->exp_nid_stats->nid_stats, opcode); -- 1.8.3.1