Skip to content

Commit

Permalink
blkcg: implement blkio_policy_type->cftypes
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tejun Heo committed Apr 1, 2012
1 parent 829fdb5 commit 44ea53d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions block/blk-cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -1538,13 +1538,19 @@ 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);

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);

Expand Down
1 change: 1 addition & 0 deletions block/blk-cgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 44ea53d

Please sign in to comment.