mas_find_rev(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… mas_find_rev(9) β€” from the Kernel API Manual bestie ✨

Okay so this is mas_find_rev, a kernel API manual page, and I'm gonna walk you through it like we're texting at 2am 🫢


✨ NAME ✨

mas_find_rev β€” on the first call, find the first non-null entry at or below mas->index down to %min. Otherwise (bestie, read carefully πŸ‘€) find the first non-null entry below mas->index down to %min.

Yeah. First call is inclusive ("at or below"), later calls are strictly below. Not me pointing that out twice πŸ’€


πŸŽ€ SYNOPSIS πŸŽ€

void * mas_find_rev (struct ma_state *mas , unsigned long min );

That's it, that's the whole vibe. Returns a void *, takes a struct ma_state * and an unsigned long. Iconic signature tbh ⭐


🌸 ARGUMENTS 🌸

  • mas β€” the maple state πŸ‘‘ this is the main character here.
  • min β€” the minimum value to check. Like, the floor. Do not go below the floor bestie πŸ™ˆ

πŸ’– DESCRIPTION πŸ’–

So, ground rules: you must hold rcu_read_lock or the write lock. Not optional, not a vibe suggestion, it's the rule πŸ”₯

If an entry exists, last and index are updated accordingly. So the state gets updated behind your back β€” but like, consensually, that's the whole design πŸ’…

Heads up: may set mas->status to ma_underflow. Lowkey dramatic but she's allowed 😭

πŸ¦‹ RETURN πŸ¦‹

The entry, or NULL. That's the whole return section, she's short and she ate 🌈


πŸ’œ SEE ALSO πŸ’œ

Grab a snack, this list is long and we're not skipping a single one fr fr πŸ“

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(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_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)

Also, kernel file ./lib/maple_tree.c β€” that's where she lives 🧚


All of these are from section 9 of the manual, so like, kernel-API coded. If you're looking for the userspace girlies, wrong section babes πŸ’€

And that's the page!! Sign-off time: this one comes from ./lib, dated October 2026 🌸 stay hydrated, hold your locks, and go find those entries in reverse bestie πŸ’…βœ¨

πŸ“¦ where this page comes from