mt_prev(9)
πΈ 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
- 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