vfs_listxattr(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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