radix_tree_...ot_protected(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… radix_tree_deref_slot_protected β€” bestie's guide to dereferencing a slot (with the lock held, obvi)

okay so this is a page from the Kernel API Manual β€” section 9, kernel stuff β€” and it's literally the most specific little function ever. it's giving "i do one thing and i do it well" energy. let's get into it ✨


🌸 NAME 🌸

radix_tree_deref_slot_protected β€” dereference a slot with tree lock held πŸ’…

like. that's the whole job. deref a slot. with the lock. held. periodt.


πŸ¦‹ SYNOPSIS πŸ¦‹

void * radix_tree_deref_slot_protected (void __rcu **slot , spinlock_t
*treelock );

so it returns a void *, takes a void __rcu **slot and a spinlock_t *treelock. that's it, that's the signature, no cap 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • slot β€” the slot pointer, returned by radix_tree_lookup_slot. yes bestie you gotta get it from there first, this function isn't out here making slots out of thin air πŸ’€
  • treelock β€” and the caller must hold this spinlock. not optional. not a suggestion. hold it. πŸ”’

🌈 DESCRIPTION 🌈

lowkey this is basically radix_tree_deref_slot's sibling β€” very similar vibes, same family. ✨

the difference? the caller does not hold the RCU read lock. instead, the caller must hold the tree lock, so parallel updates don't come in and wreck the vibe. think of it as "different lock, same goal" β€” protect the read, prevent parallel updates. πŸ”₯

bestie if you're not holding the tree lock, none of this is protected and that's a bad time. the name isn't a suggestion πŸ’€

⭐ RETURN ⭐

the entry stored in that slot. that's the whole point. that's what you came for πŸ‘‘


🧚 SEE ALSO 🧚

so there's a whole radix-tree friend group and honestly they're all iconic:

like okay go off radix tree family tree πŸŒ³πŸ’–


that's the whole page bestie β€” from the kernel source tree at ./include/linux, dated October 2026. go forth and hold your locks responsibly πŸ«ΆπŸ’…βœ¨

πŸ“¦ where this page comes from