@@ -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);
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(-)