summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2012-04-01 14:38:42 -0700
committerTejun Heo <tj@kernel.org>2012-04-01 14:38:42 -0700
commit2aa4a1523b40a065bc3a31e20097ea7a618ec3de (patch)
treeb4fb9e7e593d539f70c61c2d7b39b0028edf08eb /block
parentaaec55a002a29bf940588dc03253099a4cd543bf (diff)
downloadlinux-2aa4a1523b40a065bc3a31e20097ea7a618ec3de.tar.bz2
blkcg: BLKIO_STAT_CPU_SECTORS doesn't have subcounters
BLKIO_STAT_CPU_SECTORS doesn't need read/write/sync/async subcounters and is counted by blkio_group_stats_cpu->sectors; however, it still holds a member in blkio_group_stats_cpu->stat_arr_cpu. Rearrange stat_type_cpu and define BLKIO_STAT_CPU_ARR_NR and use it for stat_arr_cpu[] size so that only SERVICE_BYTES and SERVICED have subcounters. Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'block')
-rw-r--r--block/blk-cgroup.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h
index 1add3dcfc19d..2060d812ae8e 100644
--- a/block/blk-cgroup.h
+++ b/block/blk-cgroup.h
@@ -58,14 +58,17 @@ enum stat_type {
/* Per cpu stats */
enum stat_type_cpu {
- BLKIO_STAT_CPU_SECTORS,
/* Total bytes transferred */
BLKIO_STAT_CPU_SERVICE_BYTES,
/* Total IOs serviced, post merge */
BLKIO_STAT_CPU_SERVICED,
- BLKIO_STAT_CPU_NR
+
+ /* All the single valued stats go below this */
+ BLKIO_STAT_CPU_SECTORS,
};
+#define BLKIO_STAT_CPU_ARR_NR (BLKIO_STAT_CPU_SERVICED + 1)
+
enum stat_sub_type {
BLKIO_STAT_READ = 0,
BLKIO_STAT_WRITE,
@@ -167,7 +170,7 @@ struct blkio_group_stats {
/* Per cpu blkio group stats */
struct blkio_group_stats_cpu {
uint64_t sectors;
- uint64_t stat_arr_cpu[BLKIO_STAT_CPU_NR][BLKIO_STAT_TOTAL];
+ uint64_t stat_arr_cpu[BLKIO_STAT_CPU_ARR_NR][BLKIO_STAT_TOTAL];
struct u64_stats_sync syncp;
};