diff options
Diffstat (limited to 'block/blk-core.c')
| -rw-r--r-- | block/blk-core.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 30f6153a40c2..3ad405571dcc 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
| @@ -473,6 +473,25 @@ void blk_queue_bypass_end(struct request_queue *q) | |||
| 473 | } | 473 | } |
| 474 | EXPORT_SYMBOL_GPL(blk_queue_bypass_end); | 474 | EXPORT_SYMBOL_GPL(blk_queue_bypass_end); |
| 475 | 475 | ||
| 476 | void blk_set_queue_dying(struct request_queue *q) | ||
| 477 | { | ||
| 478 | queue_flag_set_unlocked(QUEUE_FLAG_DYING, q); | ||
| 479 | |||
| 480 | if (q->mq_ops) | ||
| 481 | blk_mq_wake_waiters(q); | ||
| 482 | else { | ||
| 483 | struct request_list *rl; | ||
| 484 | |||
| 485 | blk_queue_for_each_rl(rl, q) { | ||
| 486 | if (rl->rq_pool) { | ||
| 487 | wake_up(&rl->wait[BLK_RW_SYNC]); | ||
| 488 | wake_up(&rl->wait[BLK_RW_ASYNC]); | ||
| 489 | } | ||
| 490 | } | ||
| 491 | } | ||
| 492 | } | ||
| 493 | EXPORT_SYMBOL_GPL(blk_set_queue_dying); | ||
| 494 | |||
| 476 | /** | 495 | /** |
| 477 | * blk_cleanup_queue - shutdown a request queue | 496 | * blk_cleanup_queue - shutdown a request queue |
| 478 | * @q: request queue to shutdown | 497 | * @q: request queue to shutdown |
| @@ -486,7 +505,7 @@ void blk_cleanup_queue(struct request_queue *q) | |||
| 486 | 505 | ||
| 487 | /* mark @q DYING, no new request or merges will be allowed afterwards */ | 506 | /* mark @q DYING, no new request or merges will be allowed afterwards */ |
| 488 | mutex_lock(&q->sysfs_lock); | 507 | mutex_lock(&q->sysfs_lock); |
| 489 | queue_flag_set_unlocked(QUEUE_FLAG_DYING, q); | 508 | blk_set_queue_dying(q); |
| 490 | spin_lock_irq(lock); | 509 | spin_lock_irq(lock); |
| 491 | 510 | ||
| 492 | /* | 511 | /* |
