Expand description
Extended Attributes (xattr) – Per-Inode Metadata Store
Provides POSIX-compatible extended file attributes with namespace support. Attributes are stored in-memory (suitable for RamFS/tmpfs) using a global store keyed by inode number. Each attribute has a namespaced name (e.g., “user.mime_type” or “system.selinux”) and an arbitrary byte value.
Syscall-level functions: getxattr, setxattr, listxattr,
removexattr. Call cleanup_inode_xattrs when an inode is deleted.
Constants§
- XATTR_
CREATE - Flag: fail if the attribute already exists (exclusive create).
- XATTR_
MAX_ ATTRS_ PER_ INODE - Maximum number of attributes per inode.
- XATTR_
MAX_ NAME_ LEN - Maximum length of an attribute name (including namespace prefix).
- XATTR_
MAX_ VALUE_ SIZE - Maximum size of a single attribute value (64 KB).
- XATTR_
REPLACE - Flag: fail if the attribute does not already exist (replace only).
Functions§
- cleanup_
inode_ xattrs - Remove all extended attributes for an inode.
- count_
xattrs - Return the number of attributes currently stored for
inode. - getxattr
- Retrieve the value of an extended attribute.
- listxattr
- List all extended attribute names for an inode.
- removexattr
- Remove a single extended attribute.
- setxattr
- Set (create or replace) an extended attribute.