diff options
| author | Christoph Hellwig <hch@lst.de> | 2026-02-23 16:20:10 +0300 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2026-03-10 12:29:03 +0300 |
| commit | 19fb5f9780753bf99065f13e29cf5761eb5380db (patch) | |
| tree | 03653d737bcdebd85dd80fe1c8fceeba865a6638 | |
| parent | 4d25c7d68896b4002c4ab5cd646775392bb7fbb4 (diff) | |
| download | linux-19fb5f9780753bf99065f13e29cf5761eb5380db.tar.xz | |
iomap: only call into ->submit_read when there is a read_ctx
Move the NULL check into the callers to simplify the callees.
Fuse was missing this before, but has a constant read_ctx that is
never NULL or changed, so no change here either.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://patch.msgid.link/20260223132021.292832-11-hch@lst.de
Tested-by: Anuj Gupta <anuj20.g@samsung.com>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
| -rw-r--r-- | fs/iomap/bio.c | 5 | ||||
| -rw-r--r-- | fs/iomap/buffered-io.c | 4 | ||||
| -rw-r--r-- | fs/ntfs3/inode.c | 3 |
3 files changed, 4 insertions, 8 deletions
diff --git a/fs/iomap/bio.c b/fs/iomap/bio.c index cb60d1facb5a..80bbd328bd3c 100644 --- a/fs/iomap/bio.c +++ b/fs/iomap/bio.c @@ -21,10 +21,7 @@ static void iomap_read_end_io(struct bio *bio) static void iomap_bio_submit_read(const struct iomap_iter *iter, struct iomap_read_folio_ctx *ctx) { - struct bio *bio = ctx->read_ctx; - - if (bio) - submit_bio(bio); + submit_bio(ctx->read_ctx); } static void iomap_read_alloc_bio(const struct iomap_iter *iter, diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index f4ee2b1cb877..3cf93ab2e38a 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -596,7 +596,7 @@ void iomap_read_folio(const struct iomap_ops *ops, iter.status = iomap_read_folio_iter(&iter, ctx, &bytes_submitted); - if (ctx->ops->submit_read) + if (ctx->read_ctx && ctx->ops->submit_read) ctx->ops->submit_read(&iter, ctx); if (ctx->cur_folio) @@ -663,7 +663,7 @@ void iomap_readahead(const struct iomap_ops *ops, iter.status = iomap_readahead_iter(&iter, ctx, &cur_bytes_submitted); - if (ctx->ops->submit_read) + if (ctx->read_ctx && ctx->ops->submit_read) ctx->ops->submit_read(&iter, ctx); if (ctx->cur_folio) diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c index 511967ef7ec9..7ab4e18f8013 100644 --- a/fs/ntfs3/inode.c +++ b/fs/ntfs3/inode.c @@ -656,8 +656,7 @@ static void ntfs_iomap_bio_submit_read(const struct iomap_iter *iter, { struct bio *bio = ctx->read_ctx; - if (bio) - submit_bio(bio); + submit_bio(bio); } static const struct iomap_read_ops ntfs_iomap_bio_read_ops = { |
