Skip to content

Commit 80d0c27

Browse files
committed
erofs: get rid of raw bi_end_io() usage
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>
1 parent 30e13e4 commit 80d0c27

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

fs/erofs/fileio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ static void erofs_fileio_ki_complete(struct kiocb *iocb, long ret)
3434
if (rq->bio.bi_end_io) {
3535
if (ret < 0 && !rq->bio.bi_status)
3636
rq->bio.bi_status = errno_to_blk_status(ret);
37-
rq->bio.bi_end_io(&rq->bio);
3837
} else {
3938
bio_for_each_folio_all(fi, &rq->bio) {
4039
DBG_BUGON(folio_test_uptodate(fi.folio));
4140
erofs_onlinefolio_end(fi.folio, ret, false);
4241
}
4342
}
43+
bio_endio(&rq->bio);
4444
bio_uninit(&rq->bio);
4545
kfree(rq);
4646
}

fs/erofs/fscache.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ static void erofs_fscache_bio_endio(void *priv, ssize_t transferred_or_error)
185185

186186
if (IS_ERR_VALUE(transferred_or_error))
187187
io->bio.bi_status = errno_to_blk_status(transferred_or_error);
188-
io->bio.bi_end_io(&io->bio);
188+
bio_endio(&io->bio);
189189
BUILD_BUG_ON(offsetof(struct erofs_fscache_bio, io) != 0);
190190
erofs_fscache_io_put(&io->io);
191191
}
@@ -216,7 +216,7 @@ void erofs_fscache_submit_bio(struct bio *bio)
216216
if (!ret)
217217
return;
218218
bio->bi_status = errno_to_blk_status(ret);
219-
bio->bi_end_io(bio);
219+
bio_endio(bio);
220220
}
221221

222222
static int erofs_fscache_meta_read_folio(struct file *data, struct folio *folio)

0 commit comments

Comments
 (0)