iomap_iter(9)
π 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.statusunchanged, 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;0or negative means stop and do not bounce back into the loop body. negativeerrnois one of the two valid break-out moves. π
π SEE ALSO π
- Kernel file
./fs/iomap/iter.c iomap_iter_continue(9)
byeee π the source/version is ./fs/iomap, and this page is dated October 2026. mwah πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms