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

Commit 65c77fd9 authored by Jun'ichi Nomura's avatar Jun'ichi Nomura Committed by Jens Axboe
Browse files

blkcg: stop iteration early if root_rl is the only request list



__blk_queue_next_rl() finds next request list based on blkg_list
while skipping root_blkg in the list.
OTOH, root_rl is special as it may exist even without root_blkg.

Though the later part of the function handles such a case correctly,
exiting early is good for readability of the code.

Signed-off-by: default avatarJun'ichi Nomura <j-nomura@ce.jp.nec.com>
Cc: Tejun Heo <tj@kernel.org>
Acked-by: default avatarVivek Goyal <vgoyal@redhat.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 65635cbc
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -333,6 +333,9 @@ struct request_list *__blk_queue_next_rl(struct request_list *rl,
	 */
	 */
	if (rl == &q->root_rl) {
	if (rl == &q->root_rl) {
		ent = &q->blkg_list;
		ent = &q->blkg_list;
		/* There are no more block groups, hence no request lists */
		if (list_empty(ent))
			return NULL;
	} else {
	} else {
		blkg = container_of(rl, struct blkcg_gq, rl);
		blkg = container_of(rl, struct blkcg_gq, rl);
		ent = &blkg->q_node;
		ent = &blkg->q_node;