Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+14 −14
Original line number Diff line number Diff line
@@ -302,13 +302,17 @@ 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 {
			goto allocated;
		}
	}

	rq = __blk_mq_alloc_request(data, op);
allocated:
	if (!rq) {
		blk_queue_exit(q);
		return NULL;
	}

	if (rq) {
	if (!op_is_flush(op)) {
		rq->elv.icq = NULL;
		if (e && e->type->icq_cache)
@@ -318,10 +322,6 @@ static struct request *blk_mq_get_request(struct request_queue *q,
	return rq;
}

	blk_queue_exit(q);
	return NULL;
}

struct request *blk_mq_alloc_request(struct request_queue *q, int rw,
		unsigned int flags)
{