aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorMing Lei <tom.leiming@gmail.com>2013-12-26 08:31:36 -0500
committerJens Axboe <axboe@kernel.dk>2013-12-31 11:53:05 -0500
commitf04c1fe7619b2a60ee9e209cf3f9fcba2ce8f2a2 (patch)
tree3b5dbe682ca8cd87b466104457d3a25d0f431d2b /block
parent43a5e4e21964a6efb4d14a34644ec7109d0ae891 (diff)
block: blk-mq: make blk_sync_queue support mq
This patch moves synchronization on mq->delay_work from blk_mq_free_queue() to blk_sync_queue(), so that blk_sync_queue can work on mq. Cc: Jens Axboe <axboe@kernel.dk> Signed-off-by: Ming Lei <tom.leiming@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/blk-core.c11
-rw-r--r--block/blk-mq.c1
2 files changed, 10 insertions, 2 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index accb7fc6ec94..c00e0bdeab4a 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -246,7 +246,16 @@ EXPORT_SYMBOL(blk_stop_queue);
246void blk_sync_queue(struct request_queue *q) 246void blk_sync_queue(struct request_queue *q)
247{ 247{
248 del_timer_sync(&q->timeout); 248 del_timer_sync(&q->timeout);
249 cancel_delayed_work_sync(&q->delay_work); 249
250 if (q->mq_ops) {
251 struct blk_mq_hw_ctx *hctx;
252 int i;
253
254 queue_for_each_hw_ctx(q, hctx, i)
255 cancel_delayed_work_sync(&hctx->delayed_work);
256 } else {
257 cancel_delayed_work_sync(&q->delay_work);
258 }
250} 259}
251EXPORT_SYMBOL(blk_sync_queue); 260EXPORT_SYMBOL(blk_sync_queue);
252 261
diff --git a/block/blk-mq.c b/block/blk-mq.c
index e2f811cba417..edbd2536f942 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1440,7 +1440,6 @@ void blk_mq_free_queue(struct request_queue *q)
1440 int i; 1440 int i;
1441 1441
1442 queue_for_each_hw_ctx(q, hctx, i) { 1442 queue_for_each_hw_ctx(q, hctx, i) {
1443 cancel_delayed_work_sync(&hctx->delayed_work);
1444 kfree(hctx->ctx_map); 1443 kfree(hctx->ctx_map);
1445 kfree(hctx->ctxs); 1444 kfree(hctx->ctxs);
1446 blk_mq_free_rq_map(hctx); 1445 blk_mq_free_rq_map(hctx);