aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-cgroup.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2012-03-05 16:15:16 -0500
committerJens Axboe <axboe@kernel.dk>2012-03-06 15:27:23 -0500
commit549d3aa872cd1aec1ee540fd93afd9611faa0def (patch)
tree27c3703d3448dc0be9f58b5f01224ae901422a32 /block/blk-cgroup.h
parent1adaf3dde37a8b9b59ea59c5f58fed7761178383 (diff)
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 {
164 /* the blkg this per-policy data belongs to */ 164 /* the blkg this per-policy data belongs to */
165 struct blkio_group *blkg; 165 struct blkio_group *blkg;
166 166
167 /* Configuration */
168 struct blkio_group_conf conf;
169
170 struct blkio_group_stats stats;
171 /* Per cpu stats pointer */
172 struct blkio_group_stats_cpu __percpu *stats_cpu;
173
167 /* pol->pdata_size bytes of private data used by policy impl */ 174 /* pol->pdata_size bytes of private data used by policy impl */
168 char pdata[] __aligned(__alignof__(unsigned long long)); 175 char pdata[] __aligned(__alignof__(unsigned long long));
169}; 176};
@@ -180,16 +187,9 @@ struct blkio_group {
180 /* reference count */ 187 /* reference count */
181 int refcnt; 188 int refcnt;
182 189
183 /* Configuration */
184 struct blkio_group_conf conf;
185
186 /* Need to serialize the stats in the case of reset/update */ 190 /* Need to serialize the stats in the case of reset/update */
187 spinlock_t stats_lock; 191 spinlock_t stats_lock;
188 struct blkio_group_stats stats; 192 struct blkg_policy_data *pd[BLKIO_NR_POLICIES];
189 /* Per cpu stats pointer */
190 struct blkio_group_stats_cpu __percpu *stats_cpu;
191
192 struct blkg_policy_data *pd;
193 193
194 struct rcu_head rcu_head; 194 struct rcu_head rcu_head;
195}; 195};
@@ -249,7 +249,7 @@ extern void blkg_destroy_all(struct request_queue *q);
249static inline void *blkg_to_pdata(struct blkio_group *blkg, 249static inline void *blkg_to_pdata(struct blkio_group *blkg,
250 struct blkio_policy_type *pol) 250 struct blkio_policy_type *pol)
251{ 251{
252 return blkg ? blkg->pd->pdata : NULL; 252 return blkg ? blkg->pd[pol->plid]->pdata : NULL;
253} 253}
254 254
255/** 255/**