Commit 037cebb8 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

blk-mq: streamline blk_mq_get_request

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 6af54051
...@@ -302,24 +302,24 @@ static struct request *blk_mq_get_request(struct request_queue *q, ...@@ -302,24 +302,24 @@ static struct request *blk_mq_get_request(struct request_queue *q,
rq = e->type->ops.mq.get_request(q, op, data); rq = e->type->ops.mq.get_request(q, op, data);
if (rq) if (rq)
rq->rq_flags |= RQF_QUEUED; rq->rq_flags |= RQF_QUEUED;
} else goto allocated;
rq = __blk_mq_alloc_request(data, op); }
} else {
rq = __blk_mq_alloc_request(data, op);
} }
if (rq) { rq = __blk_mq_alloc_request(data, op);
if (!op_is_flush(op)) { allocated:
rq->elv.icq = NULL; if (!rq) {
if (e && e->type->icq_cache) blk_queue_exit(q);
blk_mq_sched_assign_ioc(q, rq, bio); return NULL;
}
data->hctx->queued++;
return rq;
} }
blk_queue_exit(q); if (!op_is_flush(op)) {
return NULL; rq->elv.icq = NULL;
if (e && e->type->icq_cache)
blk_mq_sched_assign_ioc(q, rq, bio);
}
data->hctx->queued++;
return rq;
} }
struct request *blk_mq_alloc_request(struct request_queue *q, int rw, struct request *blk_mq_alloc_request(struct request_queue *q, int rw,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment