mas_next(9)
π mas_next β Get the next entry, bestie
okay so this is a page from the Kernel API Manual, section 9, and it's literally all about mas_next. it's short, it's sweet, and it's giving "one job and it does it." let's go π
β¨ SYNOPSIS β¨
void * mas_next (struct ma_state *mas , unsigned long max );
that's it. that's the whole signature. she's not complicated π
πΈ ARGUMENTS πΈ
masβ The maple state π like, the state struct you're passing in. she holds themas->indexthat everything below is relative to.maxβ The maximum index to check. that's your ceiling, bestie. nothing past it. π§
π DESCRIPTION π
Returns the next entry after mas->index. so it's looking forward from wherever your state currently sits, not at it. iykyk β¨
π¨ real talk tho: you must hold rcu_read_lock or the write lock when you call this. no lock, no vibes. do not skip this. fr fr.
also, heads up: it can return the zero entry. so a NULL-ish looking thing isn't always the "nothing here" answer β the zero entry is a legit possible return. don't get caught out π
π¦ RETURN π¦
The next entry, or NULL. that's the whole vibe check. one or the other π
β SEE ALSO β
like, so much stuff. this function's whole social circle, in the order the page gives it, with the kernel file ./lib/maple_tree.c hanging out at the front:
mas_prealloc_calc(9)mas_wr_preallocate(9)mas_insert(9)mas_alloc_cyclic(9)mas_walk(9)mte_dead_walk(9)mt_free_walk(9)mas_store(9)mas_store_gfp(9)mas_store_prealloc(9)mas_preallocate(9)mas_next_range(9)mt_next(9)mas_prev(9)mas_prev_range(9)mt_prev(9)mas_pause(9)mas_find_setup(9)mas_find(9)mas_find_range(9)mas_find_rev_setup(9)mas_find_rev(9)mas_find_range_rev(9)mas_erase(9)mas_nomem(9)mas_nomem_nofail(9)mtree_load(9)mtree_store_range(9)mtree_store(9)mtree_insert_range(9)mtree_insert(9)mtree_alloc_cyclic(9)mtree_erase(9)__mt_dup(9)mtree_dup(9)__mt_destroy(9)mtree_destroy(9)mt_find(9)mt_find_after(9)
literally the entire friend group, no cap π
and that's the whole page, bestie!! π«Ά it lives in ./lib, it's dated October 2026, and it's filed under mas_next(9). iconic. 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