iomap_iter(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… iomap_iter(9) πŸ’…

okay so this little icon is from the Kernel API Manual, and it is literally about iterating over ranges in a file. it's giving β€œfilesystem mapping loop” energy, and honestly? obsessed. πŸ¦‹


πŸŽ€ NAME πŸŽ€

iomap_iter β€” iterate over ranges in a file. periodt.

✨ SYNOPSIS ✨

int iomap_iter (struct iomap_iter *iter , const struct iomap_ops *ops );

🫢 ARGUMENTS 🫢

  • iter β€” the iteration structure. this is your main character state, bestie.
  • ops β€” the iomap ops provided by the filesystem. the filesystem hands these over; no cap.

πŸ”₯ DESCRIPTION πŸ”₯

okay so iomap_iter iterates over filesystem-provided space mappings for the provided file range. highkey important.

it also handles cleanup of resources acquired for iteration when the filesystem indicates there are no more space mappings. which means β€” and this is the vibe check β€” this function must be called in a loop that continues as long as it returns a positive value. if 0 or a negative value is returned, the caller must not return to the loop body. don't do it. not even once. πŸ™ˆ

within a loop body, there are exactly two ways to break out:

  • leave iter.status unchanged, or
  • set it to a negative errno.

that's it, those are the exits. no extra lore, iykyk. πŸ’…

bestie, fr fr: positive return means keep looping; 0 or negative means stop and do not bounce back into the loop body. negative errno is one of the two valid break-out moves. πŸ’€

🌈 SEE ALSO 🌈


byeee πŸŽ€ the source/version is ./fs/iomap, and this page is dated October 2026. mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from