summaryrefslogtreecommitdiffstats
path: root/block/blk-cgroup.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2012-03-05 13:15:16 -0800
committerJens Axboe <axboe@kernel.dk>2012-03-06 21:27:23 +0100
commit549d3aa872cd1aec1ee540fd93afd9611faa0def (patch)
tree27c3703d3448dc0be9f58b5f01224ae901422a32 /block/blk-cgroup.h
parent1adaf3dde37a8b9b59ea59c5f58fed7761178383 (diff)
downloadlinux-549d3aa872cd1aec1ee540fd93afd9611faa0def.tar.bz2
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 <tj@kernel.org> Cc: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-cgroup.h')
-rw-r--r--block/blk-cgroup.h18
1 files changed, 9 insertions, 9 deletions
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;
}
/**