blk-mq: Micro-optimize bt_get()
authorBart Van Assche <bvanassche@acm.org>
Tue, 9 Dec 2014 15:59:48 +0000 (16:59 +0100)
committerJens Axboe <axboe@fb.com>
Tue, 9 Dec 2014 16:07:28 +0000 (09:07 -0700)
Remove a superfluous finish_wait() call. Convert the two bt_wait_ptr()
calls into a single call.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Robert Elliott <elliott@hp.com>
Cc: Ming Lei <ming.lei@canonical.com>
Cc: Alexander Gordeev <agordeev@redhat.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-mq-tag.c

index e47c4c75fd338995af72e23511e1b88ef8bf8bff..1b7229f9354a4a1043f0e2e375af7a3c98b40ac6 100644 (file)
@@ -248,8 +248,8 @@ static int bt_get(struct blk_mq_alloc_data *data,
        if (!(data->gfp & __GFP_WAIT))
                return -1;
 
-       bs = bt_wait_ptr(bt, hctx);
        do {
+               bs = bt_wait_ptr(bt, hctx);
                prepare_to_wait(&bs->wait, &wait, TASK_UNINTERRUPTIBLE);
 
                tag = __bt_get(hctx, bt, last_tag);
@@ -285,8 +285,6 @@ static int bt_get(struct blk_mq_alloc_data *data,
                        hctx = data->hctx;
                        bt = &hctx->tags->bitmap_tags;
                }
-               finish_wait(&bs->wait, &wait);
-               bs = bt_wait_ptr(bt, hctx);
        } while (1);
 
        finish_wait(&bs->wait, &wait);