if (q->elevator)
elv_drain_elevator(q);
- if (drain_all)
- blk_throtl_drain(q);
+ blk_throtl_drain(q);
/*
* This function might be called on a queue which failed
*
* In bypass mode, only the dispatch FIFO queue of @q is used. This
* function makes @q enter bypass mode and drains all requests which were
- * issued before. On return, it's guaranteed that no request has ELVPRIV
- * set.
+ * throttled or issued before. On return, it's guaranteed that no request
+ * is being throttled or has ELVPRIV set.
*/
void blk_queue_bypass_start(struct request_queue *q)
{
queue_flag_set_unlocked(QUEUE_FLAG_DEAD, q);
spin_lock_irq(lock);
+
+ /* dead queue is permanently in bypass mode till released */
+ q->bypass_depth++;
+ queue_flag_set(QUEUE_FLAG_BYPASS, q);
+
queue_flag_set(QUEUE_FLAG_NOMERGES, q);
queue_flag_set(QUEUE_FLAG_NOXMERGES, q);
queue_flag_set(QUEUE_FLAG_DEAD, q);
struct request_queue *q = td->queue;
/* no throttling for dead queue */
- if (unlikely(blk_queue_dead(q)))
+ if (unlikely(blk_queue_bypass(q)))
return NULL;
rcu_read_lock();
spin_lock_irq(q->queue_lock);
/* Make sure @q is still alive */
- if (unlikely(blk_queue_dead(q))) {
+ if (unlikely(blk_queue_bypass(q))) {
kfree(tg);
return NULL;
}