提交 72d6f02a 编写于 作者: T Tejun Heo 提交者: Jens Axboe

blk-mq: collapse __blk_mq_drain_queue() into blk_mq_freeze_queue()

Keeping __blk_mq_drain_queue() as a separate function doesn't buy us
anything and it's gonna be further simplified.  Let's flatten it into
its caller.

This patch doesn't make any functional change.
Signed-off-by: NTejun Heo <tj@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Nicholas A. Bellinger <nab@linux-iscsi.org>
Signed-off-by: NJens Axboe <axboe@fb.com>
上级 780db207
...@@ -108,8 +108,16 @@ static void blk_mq_queue_exit(struct request_queue *q) ...@@ -108,8 +108,16 @@ static void blk_mq_queue_exit(struct request_queue *q)
__percpu_counter_add(&q->mq_usage_counter, -1, 1000000); __percpu_counter_add(&q->mq_usage_counter, -1, 1000000);
} }
void blk_mq_drain_queue(struct request_queue *q) /*
* Guarantee no request is in use, so we can change any data structure of
* the queue afterward.
*/
void blk_mq_freeze_queue(struct request_queue *q)
{ {
spin_lock_irq(q->queue_lock);
q->mq_freeze_depth++;
spin_unlock_irq(q->queue_lock);
while (true) { while (true) {
s64 count; s64 count;
...@@ -124,19 +132,6 @@ void blk_mq_drain_queue(struct request_queue *q) ...@@ -124,19 +132,6 @@ void blk_mq_drain_queue(struct request_queue *q)
} }
} }
/*
* Guarantee no request is in use, so we can change any data structure of
* the queue afterward.
*/
void blk_mq_freeze_queue(struct request_queue *q)
{
spin_lock_irq(q->queue_lock);
q->mq_freeze_depth++;
spin_unlock_irq(q->queue_lock);
blk_mq_drain_queue(q);
}
static void blk_mq_unfreeze_queue(struct request_queue *q) static void blk_mq_unfreeze_queue(struct request_queue *q)
{ {
bool wake = false; bool wake = false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册