diff options
| author | Christoph Hellwig <hch@lst.de> | 2026-05-28 10:46:13 +0200 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2026-05-28 07:59:18 -0600 |
| commit | a7d8eaee7fafe2e2c58aef9579bdef778c144029 (patch) | |
| tree | fd84b54114acba07c8131265dcee29addbac7cc1 /block/blk-core.c | |
| parent | f6fe52a7b18675d76d7f7dae0c16f412a4e33f9a (diff) | |
| download | linux-a7d8eaee7fafe2e2c58aef9579bdef778c144029.tar.gz linux-a7d8eaee7fafe2e2c58aef9579bdef778c144029.tar.bz2 linux-a7d8eaee7fafe2e2c58aef9579bdef778c144029.zip | |
block: add a bio_endio_status helper
Add a helper that sets bi_status and call bio_endio() as that is a very
common pattern and convert the core block code over to it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Md Haris Iqbal <haris.iqbal@linux.dev>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hannes Reinecke <hare@kernel.org>
Link: https://patch.msgid.link/20260528084632.2505277-1-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-core.c')
| -rw-r--r-- | block/blk-core.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 22af5dec112b..b0f0a304ea0b 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -636,12 +636,10 @@ static void __submit_bio(struct bio *bio) struct gendisk *disk = bio->bi_bdev->bd_disk; if ((bio->bi_opf & REQ_POLLED) && - !(disk->queue->limits.features & BLK_FEAT_POLL)) { - bio->bi_status = BLK_STS_NOTSUPP; - bio_endio(bio); - } else { + !(disk->queue->limits.features & BLK_FEAT_POLL)) + bio_endio_status(bio, BLK_STS_NOTSUPP); + else disk->fops->submit_bio(bio); - } blk_queue_exit(disk->queue); } @@ -886,8 +884,7 @@ void submit_bio_noacct(struct bio *bio) not_supported: status = BLK_STS_NOTSUPP; end_io: - bio->bi_status = status; - bio_endio(bio); + bio_endio_status(bio, status); } EXPORT_SYMBOL(submit_bio_noacct); |