blk-mq: move update of tags->rqs to __blk_mq_alloc_request()
authorOmar Sandoval <osandov@fb.com>
Mon, 27 Feb 2017 17:47:55 +0000 (09:47 -0800)
committerJens Axboe <axboe@fb.com>
Thu, 2 Mar 2017 15:56:04 +0000 (08:56 -0700)
No functional difference, it just makes a little more sense to update
the tag map where we actually allocate the tag.

Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Tested-by: Sagi Grimberg <sagi@grimberg.me>
block/blk-mq-sched.c
block/blk-mq.c

index 5697b23412a191f5af47def780e3283d2ad51c93..09af8ff18719a42c662cbb9267812975b71666b0 100644 (file)
@@ -134,8 +134,6 @@ struct request *blk_mq_sched_get_request(struct request_queue *q,
                        rq = __blk_mq_alloc_request(data, op);
        } else {
                rq = __blk_mq_alloc_request(data, op);
-               if (rq)
-                       data->hctx->tags->rqs[rq->tag] = rq;
        }
 
        if (rq) {
index 85a7047d8b03d7a99be90942df8389a9c09d62aa..94593c6282d848687434d84ccb174bfbccbae012 100644 (file)
@@ -234,6 +234,7 @@ struct request *__blk_mq_alloc_request(struct blk_mq_alloc_data *data,
                        }
                        rq->tag = tag;
                        rq->internal_tag = -1;
+                       data->hctx->tags->rqs[rq->tag] = rq;
                }
 
                blk_mq_rq_ctx_init(data->q, data->ctx, rq, op);