simple_xattr_get(9)
π simple_xattr_get(9) β from the Kernel API Manual, bestie
okay so picture this: you're deep in the kernel, you've got a simple_xattr_cache, and you just need ONE xattr back. That's literally this function. Welcome to the simple_xattr_get glow-up, brought to you by the Kernel API Manual, section 9 (kernel interfaces, iykyk). π¦
β¨ NAME β¨
simple_xattr_get β get an xattr object. that's it. that's the whole vibe. π
β¨ SYNOPSIS β¨
int simple_xattr_get (struct simple_xattr_cache *cache , struct
list_head *xattrs , const char *name , void *buffer , size_t size );
like yes, it's a long signature, but we're gonna get through it together, fr fr. π
πΈ ARGUMENTS πΈ
cacheβ anchor for the hash table. it's the home base, the main character of the lookup. πxattrsβ the header of the xattr object. the starting point of the list.nameβ the name of the xattr to retrieve. tell her what you're looking for.bufferβ the buffer to store the value into. if you're handing this over, she's putting the value in it.sizeβ the size ofbuffer. gotta know how much room we're working with.
π« DESCRIPTION π«
So, the assignment: try to find and retrieve the xattr object associated with name.
If buffer is provided, store the value of the xattr in buffer. If you don't provide a buffer, no stress β just return the length. That's the whole trick, ngl, it's giving "let me check how big this is first" energy. π
Heads up, bestie β the size ofbufferis limited toXATTR_SIZE_MAX, which currently is65536. don't try to be extra about it. π
π₯ RETURN π₯
- On success, the length of the xattr value is returned. slay. β¨
- On error, a negative error code is returned. not the moment, but at least you know. π
π 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_space(9), simple_xattr_free(9), simple_xattr_free_rcu(9), simple_xattr_alloc(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). they all ate, honestly. π
mwah, that's the page!! sourced from ./fs, October 2026 edition, and filed under simple_xattr_get(9) β go get your xattr, bestie, you've got this π«Άπβ
π¦ 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