summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2026-02-23 16:20:11 +0300
committerChristian Brauner <brauner@kernel.org>2026-03-10 12:29:03 +0300
commit5f4fe046cb3c84eed719f7becbe822000e1a589e (patch)
tree01113d4300e65fb6be324e83f8b9f4583f8245f6 /include
parent19fb5f9780753bf99065f13e29cf5761eb5380db (diff)
downloadlinux-5f4fe046cb3c84eed719f7becbe822000e1a589e.tar.xz
iomap: allow file systems to hook into buffered read bio submission
File systems such as btrfs have additional operations with bios such as verifying data checksums. Allow file systems to hook into submission of the bio to allow for this processing by replacing the direct submit_bio call in iomap_read_alloc_bio with a call into ->submit_read and exporting iomap_read_alloc_bio. Also add a new field to struct iomap_read_folio_ctx to track the file logic offset of the current read context. Based on a patch from Goldwyn Rodrigues <rgoldwyn@suse.com>. Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://patch.msgid.link/20260223132021.292832-12-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>
Diffstat (limited to 'include')
-rw-r--r--include/linux/iomap.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/iomap.h b/include/linux/iomap.h
index 6fbe121e2adf..b2b9e649a3b8 100644
--- a/include/linux/iomap.h
+++ b/include/linux/iomap.h
@@ -493,6 +493,7 @@ struct iomap_read_folio_ctx {
struct folio *cur_folio;
struct readahead_control *rac;
void *read_ctx;
+ loff_t read_ctx_file_offset;
};
struct iomap_read_ops {
@@ -599,6 +600,9 @@ int iomap_swapfile_activate(struct swap_info_struct *sis,
extern struct bio_set iomap_ioend_bioset;
#ifdef CONFIG_BLOCK
+int iomap_bio_read_folio_range(const struct iomap_iter *iter,
+ struct iomap_read_folio_ctx *ctx, size_t plen);
+
extern const struct iomap_read_ops iomap_bio_read_ops;
static inline void iomap_bio_read_folio(struct folio *folio,