diff options
| author | Christian Brauner <brauner@kernel.org> | 2026-02-16 14:31:58 +0100 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2026-02-23 13:06:38 +0100 |
| commit | b32c4a213698ab351b44da2fd1b2a5976c7fa033 (patch) | |
| tree | fa3baa49acd5e1c871269173b68826375dedb855 /rust/kernel/interop/git@git.tavy.me:linux-stable.git | |
| parent | 94d709be8c0dc875dfc9ebb64d3b8093d0790c15 (diff) | |
xattr: add rhashtable-based simple_xattr infrastructure
Add rhashtable support to the simple_xattr subsystem while keeping the
existing rbtree code fully functional. This allows consumers to be
migrated one at a time without breaking any intermediate build.
struct simple_xattrs gains a dispatch flag and a union holding either
the rbtree (rb_root + rwlock) or rhashtable state:
struct simple_xattrs {
bool use_rhashtable;
union {
struct { struct rb_root rb_root; rwlock_t lock; };
struct rhashtable ht;
};
};
simple_xattrs_init() continues to set up the rbtree path for existing
embedded-struct callers.
Add simple_xattrs_alloc() which dynamically allocates a simple_xattrs
and initializes the rhashtable path. This is the entry point for
consumers switching to pointer-based lazy allocation.
The five core functions (get, set, list, add, free) dispatch based on
the use_rhashtable flag.
Existing callers continue to use the rbtree path unchanged. As each
consumer is converted it will switch to simple_xattrs_alloc() and the
rhashtable path. Once all consumers are converted a follow-up patch
will remove the rbtree code.
Link: https://patch.msgid.link/20260216-work-xattr-socket-v1-2-c2efa4f74cb7@kernel.org
Acked-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'rust/kernel/interop/git@git.tavy.me:linux-stable.git')
0 files changed, 0 insertions, 0 deletions
