mas_next(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 the mas->index that 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:

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