simple_xattr_free_rcu(9)
π¦ 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:
may_write_xattr(9)__vfs_setxattr_noperm(9)__vfs_setxattr_locked(9)vfs_listxattr(9)__vfs_removexattr_locked(9)generic_listxattr(9)xattr_full_name(9)simple_xattr_space(9)simple_xattr_free(9)simple_xattr_alloc(9)simple_xattr_get(9)simple_xattr_set(9)simple_xattr_set_limited(9)simple_xattr_list(9)simple_xattr_add(9)simple_xattr_add_limited(9)simple_xattrs_free(9)simple_xattr_cache_cleanup(9)
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
- 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