Skip to content

KFunc bpf_set_dentry_xattr

v6.15

Set a extended attribute(xattr) of a directory entry(dentry).

Definition

Set xattr name__str of dentry to the value in value_ptr. For security reasons, only name__str with prefix security.bpf. is allowed. The caller has not locked dentry->d_inode.

Parameters

dentry: dentry to get xattr from

name__str: name of the xattr

value_p: xattr value

flags: flags to pass into filesystem operations

Returns

0 on success, a negative value on error.

Signature

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

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