mas_find_range(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… mas_find_range(9)

okay so bestie, welcome to the Kernel API Manual entry for mas_find_range(9) β€” yes that's the manual name, and yes we're gonna get into it πŸŽ€


✨ NAME ✨

mas_find_range β€” bestie. On the first call, it finds the entry at or after mas->index up to %max. Any call after that? It just advances to the next slot at mas->index. That's it, that's the vibe πŸ¦‹


🌸 SYNOPSIS 🌸

void * mas_find_range (struct ma_state *mas , unsigned long max );

πŸ’– ARGUMENTS πŸ’–

  • mas β€” the maple state, aka the main character of this whole operation πŸ‘‘
  • max β€” the maximum value to check. That's the ceiling, fr fr πŸ”₯

🧚 DESCRIPTION 🧚

okay so important: you must hold rcu_read_lock or the write lock. no exceptions, no vibes-based workarounds πŸ’€

If an entry exists, then last and index get updated accordingly β€” slay, they stay in sync ✨

Also lowkey it may set mas->status to ma_overflow. Just so you know πŸ™ˆ


⭐ RETURN ⭐

The entry, or NULL. That's the whole deal 🫢


🌈 SEE ALSO 🌈

Kernel file ./lib/maple_tree.c, plus literally the whole friend group: 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_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) πŸ’œ


and that's the page!! this one's from ./lib, dated October 2026, and it's literally mas_find_range(9) β€” iykyk πŸ“πŸ’…βœ¨

πŸ“¦ where this page comes from