diff mbox series

[2/3] blk-mq: deduplicate blk_mq_get_tag() bits

Message ID 15662b9565f5d372e5a2fd568f1fccc083198e90.1606699505.git.asml.silence@gmail.com (mailing list archive)
State New, archived
Headers show
Series cleanups/fix for blk_mq_get_tag() | expand

Commit Message

Pavel Begunkov Nov. 30, 2020, 1:36 a.m. UTC
Deduplicate bt_wait_ptr() call in blk_mq_get_tag(), condition-less while
and absence of loop controls in-between former and current call location
makes the change functionally identical.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
 block/blk-mq-tag.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c
index dbbf11edf9a6..98f6ea219bb4 100644
--- a/block/blk-mq-tag.c
+++ b/block/blk-mq-tag.c
@@ -112,10 +112,11 @@  unsigned int blk_mq_get_tag(struct blk_mq_alloc_data *data)
 	if (data->flags & BLK_MQ_REQ_NOWAIT)
 		return BLK_MQ_NO_TAG;
 
-	ws = bt_wait_ptr(bt, data->hctx);
 	do {
 		struct sbitmap_queue *bt_prev;
 
+		ws = bt_wait_ptr(bt, data->hctx);
+
 		/*
 		 * We're out of tags on this hardware queue, kick any
 		 * pending IO submits before going to sleep waiting for
@@ -158,8 +159,6 @@  unsigned int blk_mq_get_tag(struct blk_mq_alloc_data *data)
 		 */
 		if (bt != bt_prev)
 			sbitmap_queue_wake_up(bt_prev);
-
-		ws = bt_wait_ptr(bt, data->hctx);
 	} while (1);
 
 	sbitmap_finish_wait(bt, ws, &wait);