Thread (18 messages) flat view 18 messages, 2 authors, 2021-11-04

Re: [PATCH 4/4] block: move plug rq alloc into helper and ensure queue match

From: Christoph Hellwig <hch@infradead.org>
Date: 2021-11-04 09:17:24

On Wed, Nov 03, 2021 at 12:32:22PM -0600, Jens Axboe wrote:
+	if (plug && !rq_list_empty(plug->cached_rq)) {
+		rq = rq_list_peek(&plug->cached_rq);
No need for the empty check plus peek.  This could be simplified
down to:

	if (!plug)
		return NULL;
	rq = rq_list_peek(&plug->cached_rq);
	if (!rq || rq->q != q)
		return NULL;

	rq_qos_throttle(q, bio);
	plug->cached_rq = rq_list_next(rq);
	INIT_LIST_HEAD(&rq->queuelist);
	return rq;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help