From: Christoph Hellwig Date: Wed, 30 Mar 2022 08:44:24 +0000 (+0200) Subject: block: remove a pointless ->queue dereference in __submit_bio_noacct X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Fsubmit_bio-cleanup;p=users%2Fhch%2Fblock.git block: remove a pointless ->queue dereference in __submit_bio_noacct There is a 1:1 relation between gendisk and request_queues once the gendisk is allocated, so there is no need to go out and check the queue pointer. Signed-off-by: Christoph Hellwig --- diff --git a/block/blk-core.c b/block/blk-core.c index 455186f782aa..bfc5e423b13c 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -698,7 +698,7 @@ static void __submit_bio_noacct(struct bio *bio) current->bio_list = bio_list_on_stack; do { - struct request_queue *q = bdev_get_queue(bio->bi_bdev); + struct gendisk *disk = bio->bi_bdev->bd_disk; struct bio_list lower, same; /* @@ -716,7 +716,7 @@ static void __submit_bio_noacct(struct bio *bio) bio_list_init(&lower); bio_list_init(&same); while ((bio = bio_list_pop(&bio_list_on_stack[0])) != NULL) - if (q == bdev_get_queue(bio->bi_bdev)) + if (bio->bi_bdev->bd_disk == disk) bio_list_add(&same, bio); else bio_list_add(&lower, bio);