vfs_listxattr(9)
π vfs_listxattr(9) β Kernel API Manual π¦
okay so bestie, welcome to the vfs_listxattr(9) era β this one's a kernel API page and it's genuinely so useful, i promise. let's get into it β¨
πΈ NAME πΈ
vfs_listxattr β retrieve a separated list of xattr names. that's it, that's the whole vibe. the list comes back separated, no cap π
β¨ SYNOPSIS β¨
ssize_t vfs_listxattr (struct dentry *dentry , char *list , size_t size );
look at her. three params, one ssize_t return. main character energy fr π₯
π ARGUMENTS π
dentryβ the dentry from whose inode the xattr names are retrieved. like, this is whose names we're pulling. she's the source, she's the moment πlistβ the buffer where the xattr names get stored. your little container, your vibe receptacle π«Άsizeβ the size of the buffer. yes,list's size, they're a matched set, iconic π
π DESCRIPTION π
so what does she actually do? vfs_listxattr returns the names of all xattrs associated with the inode of dentry. all of them. the whole squad π
β οΈ note β for legacy reasons, the vfs_listxattr function lists POSIX ACLs as well. yes, legacy reasons, we don't make the rules, we just document them π
and here's the lore, bestie: since POSIX ACLs are decoupled from IOP_XATTR, the vfs_listxattr function doesn't check for this flag β because a filesystem could implement POSIX ACLs without implementing any other xattrs. so she's like, not gonna gatekeep that check, y'know? π
however β and this is the part you gotta keep β since all codepaths that remove IOP_XATTR also assign inode operations that either don't implement or implement a stub ->listxattr operation. so it all works out, slay β¨
π¦ RETURN π¦
- on success π β the size of the buffer that was used
- on error π β a negative error code
that's the whole return situation. simple, clean, understood π
π SEE ALSO π
kernel file ./fs/xattr.c and honestly the whole friend group:
may_write_xattr(9), __vfs_setxattr_noperm(9), __vfs_setxattr_locked(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_xattr_add_limited(9), simple_xattrs_free(9), simple_xattr_cache_cleanup(9)
iykyk π«
okay that's the page!! before you go β cute little sign-off from the manpage itself: this one came out of ./fs and it's dated October 2026, and yeah she's still filed under vfs_listxattr(9) π mwah, go list some xattrs bestie π§ββοΈπΈ
π¦ 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