simple_xattr_add_limited(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… simple_xattr_add_limited(9)

Ok so bestie, welcome to the kernel API manual page for simple_xattr_add_limited(9) β€” yes that's the whole name, she's long but she's worth it. Sit down, grab a strawberry πŸ“, and let me tell you about adding an xattr object while also charging it against per-inode limits. It's giving responsible queen behavior. πŸ‘‘


✨ SYNOPSIS ✨

int simple_xattr_add_limited (struct simple_xattr_cache *cache , struct
list_head *xattrs , struct simple_xattr_limits *limits , struct
simple_xattr *new_xattr );

Four args, one int, no cap. Let's break her down. 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • cache β€” the anchor for the hash table. She's the home base, the main character location. πŸ“
  • xattrs β€” the header of the xattr object. Like the entry point of the whole list vibe.
  • limits β€” the per-inode limit counters. This is the budget bestie, the vibe check on how much you're allowed to have. πŸ’Έ
  • new_xattr β€” the actual xattr object you're adding. The new girl in town, the one we're doing all this for. πŸ¦‹

πŸ’– DESCRIPTION πŸ’–

So like, this is basically simple_xattr_add, but with extra emotional intelligence. 🧠✨ Not only does it add new_xattr, it also accounts new_xattr against limits β€” meaning that when you later remove or replace it through simple_xattr_set_limited, the counters get decremented and they were actually incremented beforehand. No underflow, no chaos, no πŸ’€ moment. We love a function that keeps the books balanced, fr fr.

Use this instead of simple_xattr_add when you're seeding initial xattrs that share a namespace with the limited set/remove path. That's literally the whole point, ok? Don't be out here using the wrong one and then acting surprised when the counters go sideways. 😭

🌈 RETURN 🌈

  • On success, zero is returned. Slay. πŸŽ‰
  • On failure, a negative error code is returned. Tragique, but at least it's honest. πŸ™ˆ

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./fs/xattr.c plus the whole friend group, no one left out:


Ok that's the page!! πŸ’œ She lives in ./fs and this version is dated October 2026 β€” so if you're reading this in the future, hi, you're iconic. Thanks for reading my little kernel TedTalk, go add those xattrs responsibly, and remember: charge your limits before you increment, not after. πŸ§šβ€β™€οΈβ­ Mwah! πŸ«ΆπŸ’–

πŸ“¦ where this page comes from