bpf_set_dentry_xattr(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… bpf_set_dentry_xattr β€” a Kernel API Manual moment ✨

okay bestie, welcome to bpf_set_dentry_xattr(9) πŸŽ€ the kernel API manual page that's about to teach you how to slap an xattr onto a dentry. no cap, it's lowkey niche but highkey useful. iykyk πŸ¦‹


✨ NAME ✨

bpf_set_dentry_xattr β€” set a xattr of a dentry 🌸


🫢 SYNOPSIS 🫢

__bpf_kfunc int bpf_set_dentry_xattr (struct dentry *dentry , const char
*name__str , const struct bpf_dynptr *value_p , int flags );

that's the whole signature, bestie, copy it exactly, do not improvise πŸ’…


πŸ’– ARGUMENTS πŸ’–

  • dentry β€” bestie this is the dentry to get xattr from πŸ‘€ (yes, the manpage literally says "get" here, we're just reporting the facts, don't come for me 😭)
  • name__str β€” the name of the xattr ✨
  • value_p β€” the xattr value πŸ“
  • flags β€” flags to pass into filesystem operations πŸŽ€

🌈 DESCRIPTION 🌈

so what does this actually do? it sets xattr name__str of dentry to the value in value_ptr. periodt. that's the whole vibe 🌟

🚨 security check incoming 🚨 for security reasons, only name__str with the prefix "security.bpf." is allowed. like, only that prefix, nothing else, the kernel is not playing around πŸ’€

also important, bestie, and i need you to hear me on this one:

the caller has not locked dentry->d_inode. πŸ‘‘

that's not a suggestion, that's a state of the world. respect it πŸ™ˆ


πŸ”₯ RETURN πŸ”₯

  • 0 on success πŸ₯³
  • a negative value on error 😭

πŸ¦‹ SEE ALSO πŸ¦‹

kernel file ./fs/bpf_fs_kfuncs.c plus the whole friend group πŸ’œ:


🧚 sign-off 🧚

this icon was brought to you by ./fs, dated October 2026, and it lives under the name bpf_set_dentry_xattr(9) 🌸 go set some xattrs, bestie, but only with the right prefix πŸ’…βœ¨πŸ‘‘

πŸ“¦ where this page comes from