From: Josef Bacik <[email protected]>

Batch isn't at all related to what it's actually used for, which is the
running sum of time spent doing IO.  Rename it to time so it makes
logical sense.

Signed-off-by: Josef Bacik <[email protected]>
---
 block/blk-stat.c          | 6 +++---
 include/linux/blk_types.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/block/blk-stat.c b/block/blk-stat.c
index 696a04176e4d..8a40ac719ba7 100644
--- a/block/blk-stat.c
+++ b/block/blk-stat.c
@@ -21,7 +21,7 @@ void blk_rq_stat_init(struct blk_rq_stat *stat)
 {
        stat->min = -1ULL;
        stat->max = stat->nr_samples = stat->mean = 0;
-       stat->batch = 0;
+       stat->time = 0;
 }
 
 /* src is a per-cpu stat, mean isn't initialized */
@@ -33,7 +33,7 @@ void blk_rq_stat_sum(struct blk_rq_stat *dst, struct 
blk_rq_stat *src)
        dst->min = min(dst->min, src->min);
        dst->max = max(dst->max, src->max);
 
-       dst->mean = div_u64(src->batch + dst->mean * dst->nr_samples,
+       dst->mean = div_u64(src->time + dst->mean * dst->nr_samples,
                                dst->nr_samples + src->nr_samples);
 
        dst->nr_samples += src->nr_samples;
@@ -43,7 +43,7 @@ void blk_rq_stat_add(struct blk_rq_stat *stat, u64 value)
 {
        stat->min = min(stat->min, value);
        stat->max = max(stat->max, value);
-       stat->batch += value;
+       stat->time += value;
        stat->nr_samples++;
 }
 
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index 791fee35df88..df24baf455c2 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -446,7 +446,7 @@ struct blk_rq_stat {
        u64 min;
        u64 max;
        u32 nr_samples;
-       u64 batch;
+       u64 time;
 };
 
 #endif /* __LINUX_BLK_TYPES_H */
-- 
2.17.1

Reply via email to