aboutsummaryrefslogtreecommitdiff
path: root/block/blk-cgroup.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2012-04-01 14:38:43 -0700
committerTejun Heo <tj@kernel.org>2012-04-01 14:38:43 -0700
commit44ea53de46a8b01a65ae6217f47e00b516725190 (patch)
tree45ccff782042704818d0b3f96221c381209e4a2d /block/blk-cgroup.c
parent829fdb50004de78f1bd187e428d72edcd9721cb8 (diff)
blkcg: implement blkio_policy_type->cftypes
Add blkiop->cftypes which is added and removed together with the policy. This will be used to move conf/stat handling to the policies. Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'block/blk-cgroup.c')
-rw-r--r--block/blk-cgroup.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 53976f2704a..4e714f8ddcd 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -1538,6 +1538,9 @@ void blkio_policy_register(struct blkio_policy_type *blkiop)
list_for_each_entry(q, &all_q_list, all_q_node)
update_root_blkg_pd(q, blkiop->plid);
blkcg_bypass_end();
+
+ if (blkiop->cftypes)
+ WARN_ON(cgroup_add_cftypes(&blkio_subsys, blkiop->cftypes));
}
EXPORT_SYMBOL_GPL(blkio_policy_register);
@@ -1545,6 +1548,9 @@ void blkio_policy_unregister(struct blkio_policy_type *blkiop)
{
struct request_queue *q;
+ if (blkiop->cftypes)
+ cgroup_rm_cftypes(&blkio_subsys, blkiop->cftypes);
+
blkcg_bypass_start();
spin_lock(&blkio_list_lock);