Commit 549d3aa8 authored by Tejun Heo's avatar Tejun Heo Committed by Jens Axboe

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: default avatarTejun Heo <tj@kernel.org>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 1adaf3dd
This diff is collapsed.
...@@ -164,6 +164,13 @@ struct blkg_policy_data { ...@@ -164,6 +164,13 @@ struct blkg_policy_data {
/* the blkg this per-policy data belongs to */ /* the blkg this per-policy data belongs to */
struct blkio_group *blkg; 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 */ /* pol->pdata_size bytes of private data used by policy impl */
char pdata[] __aligned(__alignof__(unsigned long long)); char pdata[] __aligned(__alignof__(unsigned long long));
}; };
...@@ -180,16 +187,9 @@ struct blkio_group { ...@@ -180,16 +187,9 @@ struct blkio_group {
/* reference count */ /* reference count */
int refcnt; int refcnt;
/* Configuration */
struct blkio_group_conf conf;
/* Need to serialize the stats in the case of reset/update */ /* Need to serialize the stats in the case of reset/update */
spinlock_t stats_lock; spinlock_t stats_lock;
struct blkio_group_stats stats; struct blkg_policy_data *pd[BLKIO_NR_POLICIES];
/* Per cpu stats pointer */
struct blkio_group_stats_cpu __percpu *stats_cpu;
struct blkg_policy_data *pd;
struct rcu_head rcu_head; struct rcu_head rcu_head;
}; };
...@@ -249,7 +249,7 @@ extern void blkg_destroy_all(struct request_queue *q); ...@@ -249,7 +249,7 @@ extern void blkg_destroy_all(struct request_queue *q);
static inline void *blkg_to_pdata(struct blkio_group *blkg, static inline void *blkg_to_pdata(struct blkio_group *blkg,
struct blkio_policy_type *pol) struct blkio_policy_type *pol)
{ {
return blkg ? blkg->pd->pdata : NULL; return blkg ? blkg->pd[pol->plid]->pdata : NULL;
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment