Whamcloud - gitweb
b=21420 fix aggregate mdt stats
authorLiuYing <emoly.liu@oracle.com>
Fri, 12 Nov 2010 01:06:06 +0000 (09:06 +0800)
committerVitaly Fertman <vitaly.fertman@sun.com>
Fri, 12 Nov 2010 20:29:56 +0000 (23:29 +0300)
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

index 24932d9..534b268 100644 (file)
@@ -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);
                                    "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);
 }
 
         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)
 {
 
 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);
 
         if (exp->exp_nid_stats && exp->exp_nid_stats->nid_stats != NULL)
                 lprocfs_counter_incr(exp->exp_nid_stats->nid_stats, opcode);