From fa224eed2b5e0f2f9a57281e9dc733c843d590ad Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 28 Nov 2016 09:25:50 -0700 Subject: blk-wbt: cleanup disable-by-default for CFQ Make it clear that we are disabling wbt for the specified queued, if it was enabled by default. This is in preparation for allowing users to re-enable wbt, and not have it disabled automatically again. Signed-off-by: Jens Axboe --- block/blk-wbt.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'block/blk-wbt.c') diff --git a/block/blk-wbt.c b/block/blk-wbt.c index 92df2f7c5af1..7c0e618d6e7d 100644 --- a/block/blk-wbt.c +++ b/block/blk-wbt.c @@ -665,15 +665,21 @@ void wbt_set_write_cache(struct rq_wb *rwb, bool write_cache_on) rwb->wc = write_cache_on; } -void wbt_disable(struct rq_wb *rwb) + /* + * Disable wbt, if enabled by default. Only called from CFQ, if we have + * cgroups enabled + */ +void wbt_disable_default(struct request_queue *q) { + struct rq_wb *rwb = q->rq_wb; + if (rwb) { del_timer_sync(&rwb->window_timer); rwb->win_nsec = rwb->min_lat_nsec = 0; wbt_update_limits(rwb); } } -EXPORT_SYMBOL_GPL(wbt_disable); +EXPORT_SYMBOL_GPL(wbt_disable_default); u64 wbt_default_latency_nsec(struct request_queue *q) { -- cgit v1.2.3-70-g09d2