aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-01-09 11:05:12 -0500
committerTejun Heo <tj@kernel.org>2013-01-09 11:05:12 -0500
commitb276a876a014c5fa58a16f247c0933f6c42112e3 (patch)
treec49f85e03d11296683ed938864bd823cdeaa614f /block
parentd02f7aa8dce8166dbbc515ce393912aa45e6b8a6 (diff)
blkcg: add blkg_policy_data->plid
Add pd->plid so that the policy a pd belongs to can be identified easily. This will be used to implement hierarchical blkg_[rw]stats. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Vivek Goyal <vgoyal@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/blk-cgroup.c2
-rw-r--r--block/blk-cgroup.h3
2 files changed, 4 insertions, 1 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 10e1df9da46e..3a8de321d1f6 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -113,6 +113,7 @@ static struct blkcg_gq *blkg_alloc(struct blkcg *blkcg, struct request_queue *q,
113 113
114 blkg->pd[i] = pd; 114 blkg->pd[i] = pd;
115 pd->blkg = blkg; 115 pd->blkg = blkg;
116 pd->plid = i;
116 117
117 /* invoke per-policy init */ 118 /* invoke per-policy init */
118 if (pol->pd_init_fn) 119 if (pol->pd_init_fn)
@@ -908,6 +909,7 @@ int blkcg_activate_policy(struct request_queue *q,
908 909
909 blkg->pd[pol->plid] = pd; 910 blkg->pd[pol->plid] = pd;
910 pd->blkg = blkg; 911 pd->blkg = blkg;
912 pd->plid = pol->plid;
911 pol->pd_init_fn(blkg); 913 pol->pd_init_fn(blkg);
912 914
913 spin_unlock(&blkg->blkcg->lock); 915 spin_unlock(&blkg->blkcg->lock);
diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h
index 24462258200e..40f5b9768aac 100644
--- a/block/blk-cgroup.h
+++ b/block/blk-cgroup.h
@@ -81,8 +81,9 @@ struct blkg_rwstat {
81 * beginning and pd_size can't be smaller than pd. 81 * beginning and pd_size can't be smaller than pd.
82 */ 82 */
83struct blkg_policy_data { 83struct blkg_policy_data {
84 /* the blkg this per-policy data belongs to */ 84 /* the blkg and policy id this per-policy data belongs to */
85 struct blkcg_gq *blkg; 85 struct blkcg_gq *blkg;
86 int plid;
86 87
87 /* used during policy activation */ 88 /* used during policy activation */
88 struct list_head alloc_node; 89 struct list_head alloc_node;