Skip to content

KFunc bpf_get_dentry_xattr

v6.12

This function gets extended attribute(xattr) of a directory entry(dentry).

Definition

Get xattr name__str of dentry and store the output in value_ptr.

For security reasons, only name__str with prefix "user." is allowed.

Parameters

dentry: dentry to get xattr from

name__str: name of the xattr

value_p: output buffer of the xattr value

Returns

0 on success, a negative value on error.

Signature

int bpf_get_dentry_xattr(struct dentry *dentry, const char *name__str, struct bpf_dynptr *value_p)

Note

This function may sleep, and therefore can only be used from sleepable programs.

Usage

Docs could be improved

This part of the docs is incomplete, contributions are very welcome

Program types

The following program types can make use of this kfunc:

Example

Docs could be improved

This part of the docs is incomplete, contributions are very welcome