mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-26 18:43:33 -05:00
blk-mq: streamline blk_mq_get_request
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
6af54051a0
commit
037cebb85b
1 changed files with 15 additions and 15 deletions
|
@ -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) {
|
|
||||||
if (!op_is_flush(op)) {
|
|
||||||
rq->elv.icq = NULL;
|
|
||||||
if (e && e->type->icq_cache)
|
|
||||||
blk_mq_sched_assign_ioc(q, rq, bio);
|
|
||||||
}
|
}
|
||||||
data->hctx->queued++;
|
|
||||||
return rq;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
blk_queue_exit(q);
|
rq = __blk_mq_alloc_request(data, op);
|
||||||
return NULL;
|
allocated:
|
||||||
|
if (!rq) {
|
||||||
|
blk_queue_exit(q);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!op_is_flush(op)) {
|
||||||
|
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,
|
||||||
|
|
Loading…
Add table
Reference in a new issue