radix_tree_replace_slot(9)
π radix_tree_replace_slot π
okay so bestie, this is radix_tree_replace_slot(9) from the Kernel API Manual, and it's giving βtiny function, very serious locking rules.β No cap, it's a quick little slot-swap situation with a big warning label. β¨
π NAME π
radix_tree_replace_slot β replace item in a slot
β¨ SYNOPSIS β¨
void radix_tree_replace_slot (struct radix_tree_root *root , void __rcu
**slot , void *item );
πΈ ARGUMENTS πΈ
rootβ the radix tree root. the main character of this whole tree situation. πslotβ pointer to slot. literally the slot pointer, bestie. πitemβ the new item to store in the slot. yes, the fresh thing going in there. π
π¦ DESCRIPTION π¦
This one is for use with radix_tree_lookup_slot and radix_tree_gang_lookup_tag_slot. π«Ά
The caller must hold the tree write locked across the slot lookup and the replacement. not optional, not βoops I forgot,β not a vibe. hold that write lock the whole time. π
β οΈ NOTE β οΈ
This cannot be used to switch between non-entries (empty slots), regular entries, and value entries, because that requires accounting inside the radix tree node. π
When switching from one type of entry or deleting, use __radix_tree_lookup and __radix_tree_replace or radix_tree_iter_replace. periodt. π
π SEE ALSO π
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_slot(9)radix_tree_lookup(9)__radix_tree_replace(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)
mwah π that's the whole page, bestie. source is ./lib, and the date/version vibe is October 2026 β go forth and replace those slots responsibly. π§πΈ
π¦ 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