iomap_iter_next(9)
π iomap_iter_next(9) β the kernel API manual, bestie edition π
okay so this is iomap_iter_next(9) from the Kernel API Manual and honestly? it's lowkey the glue holding your ->iomap_next callback together. let's get into it β¨
π NAME π
iomap_iter_next β finish the previous mapping and produce the next one. that's it, that's the whole vibe. closing one door, opening the next πͺβ¨
πΈ SYNOPSIS πΈ
int iomap_iter_next (const struct iomap_iter *iter , struct iomap *iomap
, struct iomap *srcmap , iomap_iter_begin_fn begin , iomap_iter_end_fn
end );
like, five parameters, no cap. very demure, very mindful signature π
π¦ ARGUMENTS π¦
iterβ the iteration structure, your main character of the hour πiomapβ the mapping that gets finished and then repopulated. glow-up arc fr π₯srcmapβ the source mapping, also finished and then repopulated. matching set with the one above π«Άbeginβ the callback that produces a mapping for the current position. the glow-up artist π¨endβ an optional callback that finishes the previous mapping, orNULL. optional icon behavior, we respect it π
β¨ DESCRIPTION β¨
so iomap_iter_next is an inline helper that implements the common body of an ->iomap_next callback. it's giving "shared code so nobody copies and pastes the same five lines" energy π§
here's the little routine it runs, in order:
- finishes the previous mapping via
endβ but only if present π« - decides via
iomap_iter_continuewhether to keep going π€ - obtains the next mapping via
beginπ
and here's the iconic part: this helper is marked __always_inline so that when a caller passes compile-time-constant begin and end callbacks, the compiler can call them directly β avoiding the indirect-call overhead. literally optimizing at compile time, she's so smart ππ
Returns
1to continue iterating π0once the range is fully consumed β- a negative
errnoon error π
bestie pls double-check which of the three you got β negative errno is not the same vibe as "we're done here" and you do NOT want to mix them up π
πΊ SEE ALSO πΊ
- Kernel file
./include/linux/iomap.hstruct iomap_iter(9)π iomap_length_trim(9)iomap_length(9)iomap_iter_advance_full(9)- `iomap_iter_srcmap(9)
go read the whole friend group, they all hang out together π«Άπ
and that's the page!! brought to you from ./include/linux, stamped October 2026 β mwah, slay, periodt, go write some mappings π
πβ¨
π¦ 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