Linux filesystem development
 help / color / mirror / Atom feed
* [PATCH v3 00/20] iomap: convert to in-iter iomap_next() model
@ 2026-07-20 21:01 Joanne Koong
  2026-07-20 21:01 ` [PATCH v3 01/20] iomap: split iomap_iter() logic into iomap_iter_next() Joanne Koong
                   ` (20 more replies)
  0 siblings, 21 replies; 33+ messages in thread
From: Joanne Koong @ 2026-07-20 21:01 UTC (permalink / raw)
  To: Christian Brauner, hch, Darrick J . Wong, linux-fsdevel
  Cc: changfengnan, kbusch, Matthew Wilcox, Jan Kara, Jonathan Corbet,
	David Sterba, Dan Williams, Gao Xiang, Namjae Jeon,
	Theodore Ts'o, Jaegeuk Kim, Miklos Szeredi,
	Andreas Gruenbacher, Mikulas Patocka, Hyunchul Lee,
	Konstantin Komarov, Carlos Maiolino, Damien Le Moal

This series implements a suggestion by Christoph for finishing the conversion
of iomap to an iterator model. This revives Matthew's previous RFC [1], which
had the same intention.

Every iomap operation currently drives its iteration through a struct
iomap_ops, which contains two callbacks, ->iomap_begin() and ->iomap_end().
iomap_iter() only ever sees these as pointers, so every step of every
iteration is an indirect call, including on the hottest paths. 

This series replaces the begin/end pair with a single ->iomap_next() callback
that finishes the previous mapping (if any) and produces the next one.
Collapsing to one callback lets a performance-critical caller inline its
iteration loop and pass its ->iomap_next() function as a compile-time
constant, where the compiler can devirtualize the callback into a direct and
inlineable call rather than an indirect one. It also allows future callers
more flexibility in expressing custom logic in the IO path for driving the
iteration forward.

This series has no functional changes intended. The patches are broken down as
follows:

1) Patch 1: refactors existing iomap_iter() logic into an iomap_iter_next()
function. Sets up DEFINE_IOMAP_ITER_NEXT/DEFINE_IOMAP_ITER_NEXT_END macro.

2) Patch 2: has iomap_iter() and iomap_dio_simple() paths support
->iomap_next() in addition to ->iomap_begin()/->iomap_end() callbacks

3) Patch 3: (from Fengnan) optimizes dio simple path for callers who will use
->iomap_next() who do not need an iomap_end() callback

4) Patches 4 to 17: converts each filesystem to ->iomap_next() model

5) Patch 18: Removes the legacy ->iomap_begin()/->iomap_end() path

6) Patch 19: At this point, struct iomap_ops only has one item in it, the
->iomap_next() callback. Gets rid of struct iomap_ops and passes
iomap_iter_next_fn directly.

7) Patch 20: Updates the iomap documentation to match.

This series is submitted against the vfs tree on top of the vfs-7.3.iomap
branch (head commit e1b77fb85836 "Merge patch series "iomap: add simple dio
path..."). The changes can also be found in this github link [2]. This series
was run through an ai review system for sanity-checking.

As discussed in v2 about the merge logistics [3], the plan is for patches 1 to
17 to be merged in the v7.3-rc1 cycle and for patches 18 to 20 to be merged
after v7.3-rc1 has been tagged, in order to minimize disruption to filesystems
that are currently landing iomap conversions during the 7.3 merge window.
Patches 18 to 20 are included in this series for upstream review, so that
hopefully they are all approved and ready to go when the 7.3 merge window
closes.

Thanks,
Joanne

[1] https://lore.kernel.org/linux-fsdevel/20200728173216.7184-1-willy@infradead.org/T/#u
[2] https://github.com/joannekoong/linux/tree/iomap_iter_next_v3
[3] https://lore.kernel.org/linux-fsdevel/20260703-nachrangig-gegeben-befestigen-8219a53648c7@brauner/ 

Changelog
---------
v2: https://lore.kernel.org/linux-fsdevel/20260701000949.1666714-1-joannelkoong@gmail.com/
v2 -> v3:
* Rename iomap_next_fn to iomap_iter_next_fn and iomap_process() to
  iomap_iter_next() (Darrick)
* Add integration with dio simple path, add Fengnan's patch
* Reconstruct patch that adds iomap_iter_next() logic as a refactoring of
  existing code (Christoph)
* Add DEFINE_IOMAP_ITER_NEXT{_END} macro, which nicely simplifies things
  (Christoph)
* Make documentation wording changes and a rename from dops -> next (Darrick)
* Update tracepoint in patch 19 to reflect taking iomap_iter_next_fn instead
  of ops. iomap tracepoints are explicitly called out as non-stable ABI so I
  kept Christoph's reviewed-by for this, but if that should be revoked, please
  let me know
* Add reviewed-bys

v1: https://lore.kernel.org/linux-fsdevel/20260625024723.1611000-1-joannelkoong@gmail.com/
v1 -> v2:
* Implement conversion for all callers

Fengnan Chang (1):
  iomap: skip the finishing iomap_iter() on the simple DIO read fast
    path

Joanne Koong (19):
  iomap: split iomap_iter() logic into iomap_iter_next()
  iomap: add ->iomap_next()
  xfs: convert iomap ops to ->iomap_next()
  btrfs: convert iomap ops to ->iomap_next()
  ntfs3: convert iomap ops to ->iomap_next()
  ntfs: convert iomap ops to ->iomap_next()
  ext4: convert iomap ops to ->iomap_next()
  erofs: convert iomap ops to ->iomap_next()
  zonefs: convert iomap ops to ->iomap_next()
  ext2: convert iomap ops to ->iomap_next()
  block: convert iomap ops to ->iomap_next()
  f2fs: convert iomap ops to ->iomap_next()
  gfs2: convert iomap ops to ->iomap_next()
  hpfs: convert iomap ops to ->iomap_next()
  fuse: convert iomap ops to ->iomap_next()
  exfat: convert iomap ops to ->iomap_next()
  iomap: remove ->iomap_begin()/->iomap_end() legacy path
  iomap: pass iomap_iter_next_fn directly instead of struct iomap_ops
  Documentation: iomap: update docs to reflect iomap_iter_next model

 Documentation/filesystems/iomap/design.rst    | 140 +++++++++++----
 .../filesystems/iomap/operations.rst          |  68 ++++----
 Documentation/filesystems/iomap/porting.rst   |  16 +-
 block/fops.c                                  |  10 +-
 fs/btrfs/direct-io.c                          |  10 +-
 fs/dax.c                                      |  48 +++---
 fs/erofs/data.c                               |  30 ++--
 fs/erofs/internal.h                           |   3 +-
 fs/erofs/zmap.c                               |   4 +-
 fs/exfat/file.c                               |  20 +--
 fs/exfat/inode.c                              |   6 +-
 fs/exfat/iomap.c                              |  12 +-
 fs/exfat/iomap.h                              |   6 +-
 fs/ext2/ext2.h                                |   3 +-
 fs/ext2/file.c                                |   4 +-
 fs/ext2/inode.c                               |   7 +-
 fs/ext4/ext4.h                                |   6 +-
 fs/ext4/extents.c                             |   8 +-
 fs/ext4/file.c                                |  15 +-
 fs/ext4/inode.c                               |  14 +-
 fs/f2fs/data.c                                |   4 +-
 fs/f2fs/f2fs.h                                |   3 +-
 fs/f2fs/file.c                                |   4 +-
 fs/fuse/dax.c                                 |  12 +-
 fs/fuse/file.c                                |  10 +-
 fs/fuse/virtio_fs.c                           |   3 +-
 fs/gfs2/aops.c                                |   6 +-
 fs/gfs2/bmap.c                                |   7 +-
 fs/gfs2/bmap.h                                |   3 +-
 fs/gfs2/file.c                                |   6 +-
 fs/gfs2/inode.c                               |   6 +-
 fs/hpfs/file.c                                |   6 +-
 fs/internal.h                                 |   1 -
 fs/iomap/buffered-io.c                        |  40 ++---
 fs/iomap/direct-io.c                          |  57 +++---
 fs/iomap/fiemap.c                             |   8 +-
 fs/iomap/iter.c                               | 122 ++++++-------
 fs/iomap/seek.c                               |   8 +-
 fs/iomap/swapfile.c                           |   4 +-
 fs/iomap/trace.h                              |  15 +-
 fs/ntfs/aops.c                                |   6 +-
 fs/ntfs/file.c                                |  26 +--
 fs/ntfs/inode.c                               |   2 +-
 fs/ntfs/iomap.c                               |  34 ++--
 fs/ntfs/iomap.h                               |  15 +-
 fs/ntfs3/file.c                               |  16 +-
 fs/ntfs3/inode.c                              |  11 +-
 fs/ntfs3/ntfs_fs.h                            |   3 +-
 fs/remap_range.c                              |   6 +-
 fs/xfs/xfs_aops.c                             |   8 +-
 fs/xfs/xfs_file.c                             |  48 +++---
 fs/xfs/xfs_iomap.c                            |  48 ++----
 fs/xfs/xfs_iomap.h                            |  24 ++-
 fs/xfs/xfs_iops.c                             |   4 +-
 fs/xfs/xfs_reflink.c                          |   6 +-
 fs/zonefs/file.c                              |  23 ++-
 include/linux/dax.h                           |  18 +-
 include/linux/fs.h                            |   7 +-
 include/linux/iomap.h                         | 163 +++++++++++++-----
 59 files changed, 680 insertions(+), 543 deletions(-)

-- 
2.52.0


^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2026-07-22 15:04 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-20 21:01 [PATCH v3 00/20] iomap: convert to in-iter iomap_next() model Joanne Koong
2026-07-20 21:01 ` [PATCH v3 01/20] iomap: split iomap_iter() logic into iomap_iter_next() Joanne Koong
2026-07-22 12:05   ` Christoph Hellwig
2026-07-20 21:01 ` [PATCH v3 02/20] iomap: add ->iomap_next() Joanne Koong
2026-07-22 12:06   ` Christoph Hellwig
2026-07-20 21:01 ` [PATCH v3 03/20] iomap: skip the finishing iomap_iter() on the simple DIO read fast path Joanne Koong
2026-07-20 21:01 ` [PATCH v3 04/20] xfs: convert iomap ops to ->iomap_next() Joanne Koong
2026-07-20 21:01 ` [PATCH v3 05/20] btrfs: " Joanne Koong
2026-07-21 11:39   ` David Sterba
2026-07-20 21:01 ` [PATCH v3 06/20] ntfs3: " Joanne Koong
2026-07-20 21:01 ` [PATCH v3 07/20] ntfs: " Joanne Koong
2026-07-21 10:12   ` Namjae Jeon
2026-07-20 21:01 ` [PATCH v3 08/20] ext4: " Joanne Koong
2026-07-21  7:36   ` Baokun Li
2026-07-20 21:01 ` [PATCH v3 09/20] erofs: " Joanne Koong
2026-07-20 21:01 ` [PATCH v3 10/20] zonefs: " Joanne Koong
2026-07-20 23:52   ` Damien Le Moal
2026-07-20 21:01 ` [PATCH v3 11/20] ext2: " Joanne Koong
2026-07-20 21:01 ` [PATCH v3 12/20] block: " Joanne Koong
2026-07-22 12:07   ` Christoph Hellwig
2026-07-20 21:01 ` [PATCH v3 13/20] f2fs: " Joanne Koong
2026-07-20 21:01 ` [PATCH v3 14/20] gfs2: " Joanne Koong
2026-07-20 21:01 ` [PATCH v3 15/20] hpfs: " Joanne Koong
2026-07-20 21:01 ` [PATCH v3 16/20] fuse: " Joanne Koong
2026-07-20 21:01 ` [PATCH v3 17/20] exfat: " Joanne Koong
2026-07-21 10:10   ` Namjae Jeon
2026-07-20 21:02 ` [PATCH v3 18/20] iomap: remove ->iomap_begin()/->iomap_end() legacy path Joanne Koong
2026-07-21 11:38   ` changfengnan
2026-07-20 21:02 ` [PATCH v3 19/20] iomap: pass iomap_iter_next_fn directly instead of struct iomap_ops Joanne Koong
2026-07-20 21:02 ` [PATCH v3 20/20] Documentation: iomap: update docs to reflect iomap_iter_next model Joanne Koong
2026-07-21 14:28 ` [PATCH v3 00/20] iomap: convert to in-iter iomap_next() model Christoph Hellwig
2026-07-22  7:04   ` changfengnan
2026-07-22 15:04   ` Joanne Koong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox