mt_prev(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 mt_prev(9) β€” Kernel API Manual 🌸

✨ NAME ✨

mt_prev β€” get the previous value in the maple tree. Bestie, that’s literally the whole assignment. πŸ’…

πŸ’… SYNOPSIS πŸ’…

void * mt_prev (struct maple_tree *mt , unsigned long index , unsigned
       long min );

πŸŽ€ ARGUMENTS πŸŽ€

  • mt β€” The maple tree. The tree you’re working with. 🌳
  • index β€” The start index. Where the search starts. πŸ“
  • min β€” The minimum index to check. The lower limit, no cap. ⬇️

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so mt_prev takes the RCU read lock internally to protect the search. But β€” and this is the part you cannot skip β€” that does not protect the returned pointer after dropping RCU read lock. Not me warning you about lifetime issues, but yes, that’s exactly what’s happening. 😭 See also: Documentation/core-api/maple_tree.rst.

⭐ RETURN ⭐

The entry before index, or NULL if nothing is found. Periodt. ✨

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./lib/maple_tree.c: 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), 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).


mwah πŸ’‹ β€” this page comes from ./lib, dated October 2026, and it’s all about mt_prev(9). Slay. 🫢

πŸ“¦ where this page comes from