summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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,
302 rq = e->type->ops.mq.get_request(q, op, data); 302 rq = e->type->ops.mq.get_request(q, op, data);
303 if (rq) 303 if (rq)
304 rq->rq_flags |= RQF_QUEUED; 304 rq->rq_flags |= RQF_QUEUED;
305 } else 305 goto allocated;
306 rq = __blk_mq_alloc_request(data, op); 306 }
307 } else {
308 rq = __blk_mq_alloc_request(data, op);
309 } 307 }
310 308
311 if (rq) { 309 rq = __blk_mq_alloc_request(data, op);
312 if (!op_is_flush(op)) { 310allocated:
313 rq->elv.icq = NULL; 311 if (!rq) {
314 if (e && e->type->icq_cache) 312 blk_queue_exit(q);
315 blk_mq_sched_assign_ioc(q, rq, bio); 313 return NULL;
316 }
317 data->hctx->queued++;
318 return rq;
319 } 314 }
320 315
321 blk_queue_exit(q); 316 if (!op_is_flush(op)) {
322 return NULL; 317 rq->elv.icq = NULL;
318 if (e && e->type->icq_cache)
319 blk_mq_sched_assign_ioc(q, rq, bio);
320 }
321 data->hctx->queued++;
322 return rq;
323} 323}
324 324
325struct request *blk_mq_alloc_request(struct request_queue *q, int rw, 325struct request *blk_mq_alloc_request(struct request_queue *q, int rw,