On Fri, Aug 29, 2025 at 04:56:23PM -0700, Joanne Koong wrote: > Add a "struct iomap_read_ops" that contains a read_folio_range() > callback that callers can provide as a custom handler for reading in a > folio range, if the caller does not wish to issue bio read requests > (which otherwise is the default behavior). read_folio_range() may read > the request asynchronously or synchronously. The caller is responsible > for calling iomap_start_folio_read()/iomap_finish_folio_read() when > reading the folio range. > > This makes it so that non-block based filesystems may use iomap for > reads. Also for things like checksumming in block based file systems. I've carried this patch originally from Goldwyn around for a while with my PI support patches: https://git.infradead.org/?p=users/hch/misc.git;a=commitdiff;h=54ad84fded1d954cb9ebf483008cb57421efc959 I'll see if we'll still need submit_bio with your version or if that can be reworked on top of your callout. > @@ -356,6 +356,12 @@ void iomap_finish_folio_read(struct folio *folio, size_t off, size_t len, > if (finished) > folio_end_read(folio, uptodate); > } > + > +void iomap_finish_folio_read(struct folio *folio, size_t off, size_t len, > + int error) > +{ > + return __iomap_finish_folio_read(folio, off, len, error, true); > +} > EXPORT_SYMBOL_GPL(iomap_finish_folio_read); .. > + if (ifs) > + iomap_start_folio_read(folio, 1); I don't fully understand these changes. Any chance they could be split into a prep patch with a detailed commit message so that the method addition itself is mostly mechanical? > + if (read_ops && read_ops->read_folio_range) { > + ret = read_ops->read_folio_range(iter, folio, pos, plen); > + if (ret) > + break; > + } else { > + iomap_read_folio_range_async(iter, ctx, pos, plen); > + } Overly long lines.