diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2014-10-03 11:24:46 -0700 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2014-10-03 11:24:46 -0700 |
commit | 447a8b858e4bda41c394b1bc7fdbc9dc0bdf44f6 (patch) | |
tree | 676e741f2552c9cb301e1e49c557b92bf8940f55 /block/blk-core.c | |
parent | 3049683eafdbbbd7350b0e5ca02a2d8c026a3362 (diff) | |
parent | 042e1c79166b9250edd8262bea84e1703f27ad2e (diff) | |
download | linux-447a8b858e4bda41c394b1bc7fdbc9dc0bdf44f6.tar.gz linux-447a8b858e4bda41c394b1bc7fdbc9dc0bdf44f6.tar.bz2 linux-447a8b858e4bda41c394b1bc7fdbc9dc0bdf44f6.zip |
Merge branch 'next' into for-linus
Prepare first round of input updates for 3.18.
Diffstat (limited to 'block/blk-core.c')
-rw-r--r-- | block/blk-core.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 6f8dba161bfe..bf930f481d43 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -438,14 +438,17 @@ static void __blk_drain_queue(struct request_queue *q, bool drain_all) */ void blk_queue_bypass_start(struct request_queue *q) { - bool drain; - spin_lock_irq(q->queue_lock); - drain = !q->bypass_depth++; + q->bypass_depth++; queue_flag_set(QUEUE_FLAG_BYPASS, q); spin_unlock_irq(q->queue_lock); - if (drain) { + /* + * Queues start drained. Skip actual draining till init is + * complete. This avoids lenghty delays during queue init which + * can happen many times during boot. + */ + if (blk_queue_init_done(q)) { spin_lock_irq(q->queue_lock); __blk_drain_queue(q, false); spin_unlock_irq(q->queue_lock); @@ -511,7 +514,7 @@ void blk_cleanup_queue(struct request_queue *q) * prevent that q->request_fn() gets invoked after draining finished. */ if (q->mq_ops) { - blk_mq_drain_queue(q); + blk_mq_freeze_queue(q); spin_lock_irq(lock); } else { spin_lock_irq(lock); @@ -1249,7 +1252,6 @@ void blk_rq_set_block_pc(struct request *rq) rq->__sector = (sector_t) -1; rq->bio = rq->biotail = NULL; memset(rq->__cmd, 0, sizeof(rq->__cmd)); - rq->cmd = rq->__cmd; } EXPORT_SYMBOL(blk_rq_set_block_pc); |