]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
erofs: get rid of raw bi_end_io() usage
authorGao Xiang <hsiangkao@linux.alibaba.com>
Thu, 27 Nov 2025 08:07:56 +0000 (16:07 +0800)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Sun, 30 Nov 2025 15:55:13 +0000 (23:55 +0800)
These BIOs are actually harmless in practice, as they are all pseudo
BIOs and do not use advanced features like chaining.  Using the BIO
interface is a more friendly and unified approach for both bdev and
and file-backed I/Os (compared to awkward bvec interfaces).

Let's use bio_endio() instead.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
fs/erofs/fileio.c
fs/erofs/fscache.c

index b7b3432a9882e0e0e8912e6b126405eb12204547..301647b84ca97bef486380e0b990100f89e93489 100644 (file)
@@ -34,13 +34,13 @@ static void erofs_fileio_ki_complete(struct kiocb *iocb, long ret)
        if (rq->bio.bi_end_io) {
                if (ret < 0 && !rq->bio.bi_status)
                        rq->bio.bi_status = errno_to_blk_status(ret);
-               rq->bio.bi_end_io(&rq->bio);
        } else {
                bio_for_each_folio_all(fi, &rq->bio) {
                        DBG_BUGON(folio_test_uptodate(fi.folio));
                        erofs_onlinefolio_end(fi.folio, ret, false);
                }
        }
+       bio_endio(&rq->bio);
        bio_uninit(&rq->bio);
        kfree(rq);
 }
index 362acf828279fc829fb16b9ac17f1c734ada27e7..7a346e20f7b7aa8dc2bb9bdd4fff8e02f14115f4 100644 (file)
@@ -185,7 +185,7 @@ static void erofs_fscache_bio_endio(void *priv, ssize_t transferred_or_error)
 
        if (IS_ERR_VALUE(transferred_or_error))
                io->bio.bi_status = errno_to_blk_status(transferred_or_error);
-       io->bio.bi_end_io(&io->bio);
+       bio_endio(&io->bio);
        BUILD_BUG_ON(offsetof(struct erofs_fscache_bio, io) != 0);
        erofs_fscache_io_put(&io->io);
 }
@@ -216,7 +216,7 @@ void erofs_fscache_submit_bio(struct bio *bio)
        if (!ret)
                return;
        bio->bi_status = errno_to_blk_status(ret);
-       bio->bi_end_io(bio);
+       bio_endio(bio);
 }
 
 static int erofs_fscache_meta_read_folio(struct file *data, struct folio *folio)