Use DDIR_WRITE symbolic value instead of a hard coded 2
authorJens Axboe <jens.axboe@oracle.com>
Thu, 8 Mar 2007 18:09:49 +0000 (19:09 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 8 Mar 2007 18:09:49 +0000 (19:09 +0100)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
stat.c

diff --git a/stat.c b/stat.c
index 3a1546778eeca8dbf21268f276c16616c8b6f7d2..7b4b9d576a595767e3260b87edf5116a7beab978 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -655,7 +655,7 @@ void show_run_stats(void)
                ts = &threadstats[i];
 
                memset(ts, 0, sizeof(*ts));
-               for (j = 0; j < 2; j++) {
+               for (j = 0; j <= DDIR_WRITE; j++) {
                        ts->clat_stat[j].min_val = -1UL;
                        ts->slat_stat[j].min_val = -1UL;
                        ts->bw_stat[j].min_val = -1UL;
@@ -690,7 +690,7 @@ void show_run_stats(void)
                        ts->verror = td->verror;
                }
 
-               for (l = 0; l < 2; l++) {
+               for (l = 0; l <= DDIR_WRITE; l++) {
                        sum_stat(&ts->clat_stat[l], &td->ts.clat_stat[l], idx);
                        sum_stat(&ts->slat_stat[l], &td->ts.slat_stat[l], idx);
                        sum_stat(&ts->bw_stat[l], &td->ts.bw_stat[l], idx);
@@ -737,7 +737,7 @@ void show_run_stats(void)
                ts = &threadstats[i];
                rs = &runstats[ts->groupid];
 
-               for (j = 0; j < 2; j++) {
+               for (j = 0; j <= DDIR_WRITE; j++) {
                        if (!ts->runtime[j])
                                continue;
                        if (ts->runtime[j] < rs->min_run[j] || !rs->min_run[j])