summaryrefslogtreecommitdiff
path: root/block/blk-throttle.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2012-04-13 13:11:28 -0700
committerJens Axboe <axboe@kernel.dk>2012-04-20 10:06:06 +0200
commit8bd435b30ecacb69bbb8b2d3e251f770b807c5b2 (patch)
treea1a50e95517a54a578af3967fb4016a5a1a42a68 /block/blk-throttle.c
parentec399347d39fb2337ebace928cf4a2855bd0ec37 (diff)
downloadlwn-8bd435b30ecacb69bbb8b2d3e251f770b807c5b2.tar.gz
lwn-8bd435b30ecacb69bbb8b2d3e251f770b807c5b2.zip
blkcg: remove static policy ID enums
Remove BLKIO_POLICY_* enums and let blkio_policy_register() allocate @pol->plid dynamically on registration. The maximum number of blkcg policies which can be registered at the same time is defined by BLKCG_MAX_POLS constant added to include/linux/blkdev.h. Note that blkio_policy_register() now may fail. Policy init functions updated accordingly and unnecessary ifdefs removed from cfq_init(). Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-throttle.c')
-rw-r--r--block/blk-throttle.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/block/blk-throttle.c b/block/blk-throttle.c
index 07c17c27a628..0dc4645aa7fe 100644
--- a/block/blk-throttle.c
+++ b/block/blk-throttle.c
@@ -1089,7 +1089,6 @@ static struct blkio_policy_type blkio_policy_throtl = {
.blkio_exit_group_fn = throtl_exit_blkio_group,
.blkio_reset_group_stats_fn = throtl_reset_group_stats,
},
- .plid = BLKIO_POLICY_THROTL,
.pdata_size = sizeof(struct throtl_grp),
.cftypes = throtl_files,
};
@@ -1271,8 +1270,7 @@ static int __init throtl_init(void)
if (!kthrotld_workqueue)
panic("Failed to create kthrotld\n");
- blkio_policy_register(&blkio_policy_throtl);
- return 0;
+ return blkio_policy_register(&blkio_policy_throtl);
}
module_init(throtl_init);