[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251221025233.87087-15-agruenba@redhat.com>
Date: Sun, 21 Dec 2025 03:52:29 +0100
From: Andreas Gruenbacher <agruenba@...hat.com>
To: Christoph Hellwig <hch@...radead.org>,
Jens Axboe <axboe@...nel.dk>,
Chris Mason <clm@...com>,
David Sterba <dsterba@...e.com>,
Satya Tangirala <satyat@...gle.com>
Cc: Andreas Gruenbacher <agruenba@...hat.com>,
linux-block@...r.kernel.org,
linux-btrfs@...r.kernel.org,
linux-raid@...r.kernel.org,
dm-devel@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: [RFC v2 14/17] bio: switch to bio_set_status in submit_bio_noacct
In submit_bio_noacct(), call bio_endio() and return directly when
successful. That way, bio_set_status(bio, status) will only be called
for actual errors and the compiler can optimize out the 'status !=
BLK_STS_OK' check inside bio_set_status().
Signed-off-by: Andreas Gruenbacher <agruenba@...hat.com>
---
block/blk-core.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/block/blk-core.c b/block/blk-core.c
index 381bdf66045b..acf0a82a90ce 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -821,8 +821,8 @@ void submit_bio_noacct(struct bio *bio)
if (!bdev_write_cache(bdev)) {
bio->bi_opf &= ~(REQ_PREFLUSH | REQ_FUA);
if (!bio_sectors(bio)) {
- status = BLK_STS_OK;
- goto end_io;
+ bio_endio(bio);
+ return;
}
}
}
@@ -887,7 +887,7 @@ void submit_bio_noacct(struct bio *bio)
not_supported:
status = BLK_STS_NOTSUPP;
end_io:
- bio->bi_status = status;
+ bio_set_status(bio, status);
bio_endio(bio);
}
EXPORT_SYMBOL(submit_bio_noacct);
--
2.52.0
Powered by blists - more mailing lists