From: LiuYing Date: Fri, 12 Nov 2010 01:06:06 +0000 (+0800) Subject: b=21420 fix aggregate mdt stats X-Git-Tag: 2.0.56.0~27 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=be69837105edc20cfade1f25e8f3fb5c39b2e216 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 --- 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);