diff options
author | Tejun Heo <tj@kernel.org> | 2012-04-01 17:38:43 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2012-04-01 17:38:43 -0400 |
commit | 44ea53de46a8b01a65ae6217f47e00b516725190 (patch) | |
tree | 45ccff782042704818d0b3f96221c381209e4a2d | |
parent | 829fdb50004de78f1bd187e428d72edcd9721cb8 (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>
-rw-r--r-- | block/blk-cgroup.c | 6 | ||||
-rw-r--r-- | block/blk-cgroup.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 53976f2704a5..4e714f8ddcd2 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c | |||
@@ -1538,6 +1538,9 @@ void blkio_policy_register(struct blkio_policy_type *blkiop) | |||
1538 | list_for_each_entry(q, &all_q_list, all_q_node) | 1538 | list_for_each_entry(q, &all_q_list, all_q_node) |
1539 | update_root_blkg_pd(q, blkiop->plid); | 1539 | update_root_blkg_pd(q, blkiop->plid); |
1540 | blkcg_bypass_end(); | 1540 | blkcg_bypass_end(); |
1541 | |||
1542 | if (blkiop->cftypes) | ||
1543 | WARN_ON(cgroup_add_cftypes(&blkio_subsys, blkiop->cftypes)); | ||
1541 | } | 1544 | } |
1542 | EXPORT_SYMBOL_GPL(blkio_policy_register); | 1545 | EXPORT_SYMBOL_GPL(blkio_policy_register); |
1543 | 1546 | ||
@@ -1545,6 +1548,9 @@ void blkio_policy_unregister(struct blkio_policy_type *blkiop) | |||
1545 | { | 1548 | { |
1546 | struct request_queue *q; | 1549 | struct request_queue *q; |
1547 | 1550 | ||
1551 | if (blkiop->cftypes) | ||
1552 | cgroup_rm_cftypes(&blkio_subsys, blkiop->cftypes); | ||
1553 | |||
1548 | blkcg_bypass_start(); | 1554 | blkcg_bypass_start(); |
1549 | spin_lock(&blkio_list_lock); | 1555 | spin_lock(&blkio_list_lock); |
1550 | 1556 | ||
diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h index 361ecfa4d28d..fa744d57bebb 100644 --- a/block/blk-cgroup.h +++ b/block/blk-cgroup.h | |||
@@ -181,6 +181,7 @@ struct blkio_policy_type { | |||
181 | struct blkio_policy_ops ops; | 181 | struct blkio_policy_ops ops; |
182 | enum blkio_policy_id plid; | 182 | enum blkio_policy_id plid; |
183 | size_t pdata_size; /* policy specific private data size */ | 183 | size_t pdata_size; /* policy specific private data size */ |
184 | struct cftype *cftypes; /* cgroup files for the policy */ | ||
184 | }; | 185 | }; |
185 | 186 | ||
186 | extern int blkcg_init_queue(struct request_queue *q); | 187 | extern int blkcg_init_queue(struct request_queue *q); |