diff options
author | Tejun Heo <tj@kernel.org> | 2012-04-01 17:38:45 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2012-04-01 17:38:45 -0400 |
commit | 5bc4afb1ec6aa562fac4d9aba34d957ee42f5813 (patch) | |
tree | dfef1de2dcb71beab3150ffecf6ae564d326ffba /block/blk-throttle.c | |
parent | d366e7ec41882791c970dfb7c67b737be8c3a174 (diff) |
blkcg: drop BLKCG_STAT_{PRIV|POL|OFF} macros
Now that all stat handling code lives in policy implementations,
there's no need to encode policy ID in cft->private.
* Export blkcg_prfill_[rw]stat() from blkcg, remove
blkcg_print_[rw]stat(), and implement cfqg_print_[rw]stat() which
use hard-code BLKIO_POLICY_PROP.
* Use cft->private for offset of the target field directly and drop
BLKCG_STAT_{PRIV|POL|OFF}().
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'block/blk-throttle.c')
-rw-r--r-- | block/blk-throttle.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/block/blk-throttle.c b/block/blk-throttle.c index bd6dbfe1e4e9..60240142f5ae 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c | |||
@@ -941,15 +941,13 @@ static u64 tg_prfill_cpu_rwstat(struct seq_file *sf, void *pdata, int off) | |||
941 | return __blkg_prfill_rwstat(sf, pdata, &rwstat); | 941 | return __blkg_prfill_rwstat(sf, pdata, &rwstat); |
942 | } | 942 | } |
943 | 943 | ||
944 | /* print per-cpu blkg_rwstat specified by BLKCG_STAT_PRIV() */ | ||
945 | static int tg_print_cpu_rwstat(struct cgroup *cgrp, struct cftype *cft, | 944 | static int tg_print_cpu_rwstat(struct cgroup *cgrp, struct cftype *cft, |
946 | struct seq_file *sf) | 945 | struct seq_file *sf) |
947 | { | 946 | { |
948 | struct blkio_cgroup *blkcg = cgroup_to_blkio_cgroup(cgrp); | 947 | struct blkio_cgroup *blkcg = cgroup_to_blkio_cgroup(cgrp); |
949 | 948 | ||
950 | blkcg_print_blkgs(sf, blkcg, tg_prfill_cpu_rwstat, | 949 | blkcg_print_blkgs(sf, blkcg, tg_prfill_cpu_rwstat, BLKIO_POLICY_THROTL, |
951 | BLKCG_STAT_POL(cft->private), | 950 | cft->private, true); |
952 | BLKCG_STAT_OFF(cft->private), true); | ||
953 | return 0; | 951 | return 0; |
954 | } | 952 | } |
955 | 953 | ||
@@ -1067,14 +1065,12 @@ static struct cftype throtl_files[] = { | |||
1067 | }, | 1065 | }, |
1068 | { | 1066 | { |
1069 | .name = "throttle.io_service_bytes", | 1067 | .name = "throttle.io_service_bytes", |
1070 | .private = BLKCG_STAT_PRIV(BLKIO_POLICY_THROTL, | 1068 | .private = offsetof(struct tg_stats_cpu, service_bytes), |
1071 | offsetof(struct tg_stats_cpu, service_bytes)), | ||
1072 | .read_seq_string = tg_print_cpu_rwstat, | 1069 | .read_seq_string = tg_print_cpu_rwstat, |
1073 | }, | 1070 | }, |
1074 | { | 1071 | { |
1075 | .name = "throttle.io_serviced", | 1072 | .name = "throttle.io_serviced", |
1076 | .private = BLKCG_STAT_PRIV(BLKIO_POLICY_THROTL, | 1073 | .private = offsetof(struct tg_stats_cpu, serviced), |
1077 | offsetof(struct tg_stats_cpu, serviced)), | ||
1078 | .read_seq_string = tg_print_cpu_rwstat, | 1074 | .read_seq_string = tg_print_cpu_rwstat, |
1079 | }, | 1075 | }, |
1080 | { } /* terminate */ | 1076 | { } /* terminate */ |