]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
xattr: add rcu_head and rhash_head to struct simple_xattr
authorChristian Brauner <brauner@kernel.org>
Mon, 16 Feb 2026 13:31:57 +0000 (14:31 +0100)
committerChristian Brauner <brauner@kernel.org>
Mon, 23 Feb 2026 12:06:38 +0000 (13:06 +0100)
commit94d709be8c0dc875dfc9ebb64d3b8093d0790c15
tree0c8ac990b75854bc6023cd92747da0548cd2c73b
parent6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f
xattr: add rcu_head and rhash_head to struct simple_xattr

In preparation for converting simple_xattrs from rbtree to rhashtable,
add rhash_head and rcu_head members to struct simple_xattr. The
rhashtable implementation will use rhash_head for hash table linkage
and RCU-based lockless reads, requiring that replaced or removed xattr
entries be freed via call_rcu() rather than immediately.

Add simple_xattr_free_rcu() which schedules RCU-deferred freeing of an
xattr entry.  This will be used by callers of simple_xattr_set() once
they switch to the rhashtable-based xattr store.

No functional changes.

Link: https://patch.msgid.link/20260216-work-xattr-socket-v1-1-c2efa4f74cb7@kernel.org
Acked-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/xattr.c
include/linux/xattr.h