summaryrefslogtreecommitdiff
path: root/fs/kernfs/kernfs-internal.h
diff options
context:
space:
mode:
authorJinliang Zheng <alexjlzheng@tencent.com>2025-04-15 23:36:58 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-04-25 16:01:56 +0200
commitcec59c440a05c241846e8fe9d2575a2dafb56fd9 (patch)
treea7216443f4c042074eac1b9fc98b3141b02a2c06 /fs/kernfs/kernfs-internal.h
parent2806c6b8f3d1e406f2b7e3266ddd21100fbe7151 (diff)
kernfs: switch global kernfs_idr_lock to per-fs lock
The kernfs implementation has big lock granularity(kernfs_idr_lock) so every kernfs-based(e.g., sysfs, cgroup) fs are able to compete the lock. This patch switches the global kernfs_idr_lock to per-fs lock, which put the spinlock into kernfs_root. Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com> Acked-by: Tejun Heo <tj@kernel.org> Link: https://lore.kernel.org/r/20250415153659.14950-2-alexjlzheng@tencent.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/kernfs/kernfs-internal.h')
-rw-r--r--fs/kernfs/kernfs-internal.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/kernfs/kernfs-internal.h b/fs/kernfs/kernfs-internal.h
index 40a2a9cd819d..24e9514565ac 100644
--- a/fs/kernfs/kernfs-internal.h
+++ b/fs/kernfs/kernfs-internal.h
@@ -40,6 +40,7 @@ struct kernfs_root {
/* private fields, do not use outside kernfs proper */
struct idr ino_idr;
+ spinlock_t kernfs_idr_lock; /* root->ino_idr */
u32 last_id_lowbits;
u32 id_highbits;
struct kernfs_syscall_ops *syscall_ops;