mas_for_each(9)
π
mas_for_each(9) β Kernel API Manual π
okay bestie, we're in the Kernel API Manual and today's main character is mas_for_each(9). it's giving "walk a range of the maple tree" energy, and yes, we're gonna go through every single deet. no cap. β¨
πΈ NAME πΈ
mas_for_each β Iterate over a range of the maple tree.
β SYNOPSIS β
mas_for_each (__mas , __entry , __max );
π ARGUMENTS π
__masβ Maple Tree operation state (maple_state). it's the state your operation is carrying, periodt.__entryβ Entry retrieved from the tree. literally the thing you got back, bestie.__maxβ maximum index to retrieve from the tree. the upper limit of the range.
π¦ DESCRIPTION π¦
When returned, mas->index and mas->last will hold the entire range for the entry. yes, the whole range β both fields, no crumbs. π
π NOTE π
heads up, bestie: it may return the zero entry. that's the note, and we are respecting it. π
π₯ SEE ALSO π₯
- Kernel file
./include/linux/maple_tree.h Maple tree flags(9)MTREE_INIT(9)MTREE_INIT_EXT(9)mtree_empty(9)mas_reset(9)mas_for_each_rev(9)__mas_set_range(9)mas_set_range(9)mas_set(9)mt_init_flags(9)mt_init(9)mt_clear_in_rcu(9)mt_set_in_rcu(9)mt_for_each(9)
mwah π this lil page is sourced from ./include/linux, dated October 2026, and it's all about mas_for_each(9). periodt β¨π«Ά
π¦ 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