simple_xattr_add_limited(9)
π 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:
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_free_rcu(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_xattrs_free(9)simple_xattr_cache_cleanup(9)
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
- 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