From 549d3aa872cd1aec1ee540fd93afd9611faa0def Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Mon, 5 Mar 2012 13:15:16 -0800 Subject: blkcg: make blkg->pd an array and move configuration and stats into it To prepare for unifying blkgs for different policies, make blkg->pd an array with BLKIO_NR_POLICIES elements and move blkg->conf, ->stats, and ->stats_cpu into blkg_policy_data. This patch doesn't introduce any functional difference. Signed-off-by: Tejun Heo Cc: Vivek Goyal Signed-off-by: Jens Axboe --- block/blk-cgroup.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'block/blk-cgroup.h') diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h index 7da106843f01..5dffd436f30d 100644 --- a/block/blk-cgroup.h +++ b/block/blk-cgroup.h @@ -164,6 +164,13 @@ struct blkg_policy_data { /* the blkg this per-policy data belongs to */ struct blkio_group *blkg; + /* Configuration */ + struct blkio_group_conf conf; + + struct blkio_group_stats stats; + /* Per cpu stats pointer */ + struct blkio_group_stats_cpu __percpu *stats_cpu; + /* pol->pdata_size bytes of private data used by policy impl */ char pdata[] __aligned(__alignof__(unsigned long long)); }; @@ -180,16 +187,9 @@ struct blkio_group { /* reference count */ int refcnt; - /* Configuration */ - struct blkio_group_conf conf; - /* Need to serialize the stats in the case of reset/update */ spinlock_t stats_lock; - struct blkio_group_stats stats; - /* Per cpu stats pointer */ - struct blkio_group_stats_cpu __percpu *stats_cpu; - - struct blkg_policy_data *pd; + struct blkg_policy_data *pd[BLKIO_NR_POLICIES]; struct rcu_head rcu_head; }; @@ -249,7 +249,7 @@ extern void blkg_destroy_all(struct request_queue *q); static inline void *blkg_to_pdata(struct blkio_group *blkg, struct blkio_policy_type *pol) { - return blkg ? blkg->pd->pdata : NULL; + return blkg ? blkg->pd[pol->plid]->pdata : NULL; } /** -- cgit v1.2.3-59-g8ed1b