simple_xattr_free_rcu(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ simple_xattr_free_rcu(9) β€” kernel API manual energy ✨

okay so bestie, we're in the Kernel API Manual today and this page is literally about freeing one (1) xattr object but like… politely. With a delay. RCU style. iykyk πŸ’…


🌸 NAME 🌸

simple_xattr_free_rcu β€” free an xattr object with an RCU delay, no cap


✨ SYNOPSIS ✨

void simple_xattr_free_rcu (struct simple_xattr *xattr );

that's it. that's the whole signature. she's short and she knows it πŸŽ€


🫢 ARGUMENTS 🫢

  • xattr β€” the xattr object. yes, the xattr object. the one and only. main character energy fr πŸ”₯

πŸ’– DESCRIPTION πŸ’–

so what she does is: free the xattr object after an RCU grace period. like, she doesn't just yank it β€” she waits her turn, gracefully, the way a queen would πŸ‘‘

you must use this one when the xattr was removed from a data structure that concurrent RCU readers may still be traversing. the readers are still walking through, so you can't just snatch the object out from under them, that would be so rude (and also a use-after-free, which is not the vibe πŸ’€).

and the cute part? she can totally handle xattr being NULL. no crash, no drama, she just handles it. icon behavior tbh 🧚

lowkey important: this isn't a "free whenever" situation. the whole point is the RCU grace period, so use it specifically for the removed-from-RCU-traversed-structure case, okay? don't improvise πŸ™ˆ

🌈 SEE ALSO 🌈

sibling functions, the whole friend group, from the kernel file ./fs/xattr.c:

like, the entire simple_xattr cinematic universe is right there. go read them. obsessed πŸ“


and that's the page bestie!! πŸ’œ this whole thing comes from the source ./fs, dated October 2026, filed under the Kernel API Manual β€” mwah, sending you a little RCU grace period of your own, stay safe out there πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from