]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
blk-mq: collapse __blk_mq_drain_queue() into blk_mq_freeze_queue()
authorTejun Heo <tj@kernel.org>
Tue, 1 Jul 2014 16:33:02 +0000 (10:33 -0600)
committerJens Axboe <axboe@fb.com>
Tue, 1 Jul 2014 16:33:02 +0000 (10:33 -0600)
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: Tejun Heo <tj@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Nicholas A. Bellinger <nab@linux-iscsi.org>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-mq.c

index 1e324a123d40261ed5e4e0d1702f4e4ea0c562c9..22682fb4be6552886cb491f0ee687e7ab7ad6359 100644 (file)
@@ -108,8 +108,16 @@ static void blk_mq_queue_exit(struct request_queue *q)
        __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) {
                s64 count;
 
@@ -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)
 {
        bool wake = false;