⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

Module xattr

Module xattr 

Source
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.