simple_xattr_space(9)
โจ simple_xattr_space(9) โจ
okay so bestie, welcome to the simple_xattr_space(9) page โ that's the kernel API manual, and this one's a little cutie that just does math for you ๐งฎ๐
๐ธ NAME ๐ธ
simple_xattr_space โ the vibe-check function that estimates how much memory a simple xattr is gonna eat up ๐
๐ฆ SYNOPSIS ๐ฆ
size_t simple_xattr_space (const char *name , size_t size );
๐ ARGUMENTS ๐
nameโ the full name of the xattr, like the whole thing, not a nickname ๐sizeโ the size of its value, aka how chunky the actual data is
๐ DESCRIPTION ๐
so here's the thing, right? This function is not out here trying to be all "oh the two slab objects are actually this much bigger." Nope. It takes no account of how much larger the two slab objects actually are ๐
And honestly? That's on purpose, because that real size would depend on the slab implementation โ and what's required here is a deterministic number. A number that just grows with name length, and with size, and with quantity. Consistent. Predictable. Main character energy ๐ โจ
๐ RETURN ๐
It hands you back the approximate number of bytes of memory used by such an xattr. Approximate, bestie, remember that ๐ซถ
๐ฅ SEE ALSO ๐ฅ
Kernel file ./fs/xattr.c plus the whole friend group:
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_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_xattr_add_limited(9)simple_xattrs_free(9)simple_xattr_cache_cleanup(9)
and that's the whole page, no cap ๐ this one's sourced from ./fs and dated October 2026 โ mwah, go estimate some memory, you icon ๐๐ฆ
๐ฆ 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