Skip to content

Commit

Permalink
cfq: don't register propio policy if !CONFIG_CFQ_GROUP_IOSCHED
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tejun Heo authored and Jens Axboe committed Mar 6, 2012
1 parent 32e380a commit b95ada5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -3878,8 +3878,6 @@ static struct blkio_policy_type blkio_policy_cfq = {
},
.plid = BLKIO_POLICY_PROP,
};
#else
static struct blkio_policy_type blkio_policy_cfq;
#endif

static int __init cfq_init(void)
Expand Down Expand Up @@ -3910,14 +3908,17 @@ static int __init cfq_init(void)
return ret;
}

#ifdef CONFIG_CFQ_GROUP_IOSCHED
blkio_policy_register(&blkio_policy_cfq);

#endif
return 0;
}

static void __exit cfq_exit(void)
{
#ifdef CONFIG_CFQ_GROUP_IOSCHED
blkio_policy_unregister(&blkio_policy_cfq);
#endif
elv_unregister(&iosched_cfq);
kmem_cache_destroy(cfq_pool);
}
Expand Down

0 comments on commit b95ada5

Please sign in to comment.