radix_tree_iter_delete(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ radix_tree_iter_delete(9) ✨

okay so this is radix_tree_iter_delete from the Kernel API Manual, and bestie, it does exactly one thing and it does it slayfully: it deletes the entry sitting at your iterator's current position. that's it. that's the whole vibe. πŸŽ€


πŸ’– NAME πŸ’–

radix_tree_iter_delete β€” delete the entry at this iterator position πŸ—‘οΈβœ¨


πŸ¦‹ SYNOPSIS πŸ¦‹

void radix_tree_iter_delete (struct radix_tree_root *root , struct
       radix_tree_iter *iter , void __rcu **slot );

like, that's the whole signature, no cap. three args, void return, nothing returned to you except a slightly emptier radix tree. πŸ’…


🌸 ARGUMENTS 🌸

  • root β€” the radix tree root 🌳 like, which tree are we messing with? this one.
  • iter β€” the iterator state 🧭 it's the little guy keeping track of where you are.
  • slot β€” pointer to slot πŸ“ it's a void __rcu **, so mind your RCU manners, bestie.

πŸ”₯ DESCRIPTION πŸ”₯

okay so here's the tea β˜• β€” this function deletes the entry at the position that the iterator is currently pointing at. poof. gone. iconic behavior honestly.

and here's the part you actually need to know: this may result in the current node being freed 😭 like, the node can genuinely get deallocated out from under you. but !!! the glow-up is that if that happens, the iterator is advanced so it will not reference the freed memory 🫢 so the iterator keeps itself safe, main character energy fr fr.

also, ngl, this function may be called without any locking β€” but ONLY if there are no other threads which can access this tree. read that again, bestie. no other threads. zero. if anybody else can touch this tree, you're gonna have a bad time πŸ’€πŸ”’

⚠️ seriously though: the no-locking thing is conditional. no other threads accessing the tree = you're free to rawdog it with no lock. otherwise? lock it up. 🚨

🌈 SEE ALSO 🌈

all the sibling functions, in the exact order the kernel gave them, because we do not reorder the homies πŸ™ˆ


and that's the page, babes πŸ§šπŸ’œ this one lives in ./lib and it's dated October 2026, filed under radix_tree_iter_delete(9) β€” go delete something responsibly, ily, bye πŸ’…βœ¨

πŸ“¦ where this page comes from