summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-06-16 18:15:23 +0200
committerJens Axboe <axboe@kernel.dk>2017-06-18 10:08:55 -0600
commit037cebb85b94027a52be69d72068e6f6d0dca3a3 (patch)
tree414bdaa60c1473c8c0f559f53b8570dffba76239 /block
parent6af54051a07041d8d4e36b1b01136a0db4eb7e23 (diff)
downloadlinux-stable-037cebb85b94027a52be69d72068e6f6d0dca3a3.tar.gz
linux-stable-037cebb85b94027a52be69d72068e6f6d0dca3a3.tar.bz2
linux-stable-037cebb85b94027a52be69d72068e6f6d0dca3a3.zip
blk-mq: streamline blk_mq_get_request
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/blk-mq.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 0b17351fccfc..e056725679a8 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -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);
if (rq)
rq->rq_flags |= RQF_QUEUED;
- } else
- rq = __blk_mq_alloc_request(data, op);
- } else {
- rq = __blk_mq_alloc_request(data, op);
+ goto allocated;
+ }
}
- 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;
+ rq = __blk_mq_alloc_request(data, op);
+allocated:
+ if (!rq) {
+ blk_queue_exit(q);
+ return NULL;
}
- 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,