blkcg: implement blkio_policy_type->cftypes
authorTejun Heo <tj@kernel.org>
Sun, 1 Apr 2012 21:38:43 +0000 (14:38 -0700)
committerTejun Heo <tj@kernel.org>
Sun, 1 Apr 2012 21:38:43 +0000 (14:38 -0700)
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>
block/blk-cgroup.c
block/blk-cgroup.h

index 53976f2704a56f83dce134b660365d180699561a..4e714f8ddcd2b53880c34026fb56c396e3e03865 100644 (file)
@@ -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);
 
index 361ecfa4d28dc00e5fa2d7b654a8cb08cf501b68..fa744d57bebbd17093c98d4922c63bb7f3d20833 100644 (file)
@@ -181,6 +181,7 @@ struct blkio_policy_type {
        struct blkio_policy_ops ops;
        enum blkio_policy_id plid;
        size_t pdata_size;              /* policy specific private data size */
+       struct cftype *cftypes;         /* cgroup files for the policy */
 };
 
 extern int blkcg_init_queue(struct request_queue *q);
This page took 0.028016 seconds and 5 git commands to generate.