From 86e710a3dd23704d3129ecee207749af2ca07953 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Wed, 30 Mar 2022 10:44:24 +0200 Subject: [PATCH] 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 --- block/blk-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 2.50.1