radix_tree_lookup_slot(9)
β¨ radix_tree_lookup_slot β¨
okay so bestie, this is the radix_tree_lookup_slot page from the Kernel API Manual and it's literally all about grabbing a slot out of a radix tree π³π
no cap, it's a whole thing and we're gonna get through it together π«Ά
πΈ SYNOPSIS πΈ
void __rcu ** radix_tree_lookup_slot (const struct radix_tree_root *root
, unsigned long index );
like, that's the whole signature, slay β¨
π ARGUMENTS π
rootβ the radix tree root, aka where it all begins, the main character of the tree πindexβ the index key, the lil coordinate you're looking up π
π RETURN π
so it returns the slot corresponding to the position index in the radix tree root. it's giving "find my spot" energy π―
and lowkey, this one is useful for update-if-exists operations β like, if you wanna update something only when it's already there, this is your girl πββοΈ
π¦ DESCRIPTION π¦
okay this is the important part, bestie, listen up π
This function can be called under rcu_read_lock iff the slot is not modified by radix_tree_replace_slot, otherwise it must be called exclusive from other writers. periodt.
β οΈ and ALSO β any dereference of the slot must be done using radix_tree_deref_slot. do not skip this, it's not a vibe to ignore it fr fr π
π SEE ALSO π
so here's the whole friend group, the entire squad of related calls, iconic lineup honestly π§β¨:
- Kernel file
./lib/radix-tree.c radix_tree_find_next_bit(9)radix_tree_shrink(9)__radix_tree_create(9)radix_tree_insert(9)__radix_tree_lookup(9)radix_tree_lookup(9)__radix_tree_replace(9)radix_tree_replace_slot(9)radix_tree_iter_replace(9)radix_tree_tag_set(9)radix_tree_tag_clear(9)radix_tree_iter_tag_clear(9)radix_tree_tag_get(9)radix_tree_next_chunk(9)radix_tree_gang_lookup(9)radix_tree_gang_lookup_tag(9)radix_tree_gang_lookup_tag_slot(9)radix_tree_iter_delete(9)radix_tree_delete_item(9)radix_tree_delete(9)radix_tree_tagged(9)idr_preload(9)idr_destroy(9)
and that's the whole page, bestie, you ate that π
β¨ big thank you to ./lib for this one, dated October 2026 β we stan a documented kernel π«Άπ
π¦ 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