Skip to content

Commit b95ada5

Browse files
htejunaxboe
authored andcommitted
cfq: don't register propio policy if !CONFIG_CFQ_GROUP_IOSCHED
cfq has been registering zeroed blkio_poilcy_cfq if CFQ_GROUP_IOSCHED is disabled. This fortunately doesn't collide with blk-throtl as BLKIO_POLICY_PROP is zero but is unnecessary and risky. Just don't register it if not enabled. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 32e380a commit b95ada5

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎block/cfq-iosched.c‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3878,8 +3878,6 @@ static struct blkio_policy_type blkio_policy_cfq = {
38783878
},
38793879
.plid = BLKIO_POLICY_PROP,
38803880
};
3881-
#else
3882-
static struct blkio_policy_type blkio_policy_cfq;
38833881
#endif
38843882

38853883
static int __init cfq_init(void)
@@ -3910,14 +3908,17 @@ static int __init cfq_init(void)
39103908
return ret;
39113909
}
39123910

3911+
#ifdef CONFIG_CFQ_GROUP_IOSCHED
39133912
blkio_policy_register(&blkio_policy_cfq);
3914-
3913+
#endif
39153914
return 0;
39163915
}
39173916

39183917
static void __exit cfq_exit(void)
39193918
{
3919+
#ifdef CONFIG_CFQ_GROUP_IOSCHED
39203920
blkio_policy_unregister(&blkio_policy_cfq);
3921+
#endif
39213922
elv_unregister(&iosched_cfq);
39223923
kmem_cache_destroy(cfq_pool);
39233924
}

0 commit comments

Comments
 (0)