aboutsummaryrefslogtreecommitdiffstats
path: root/fs/kernfs/kernfs-internal.h
diff options
context:
space:
mode:
authorJinliang Zheng <[email protected]>2025-04-15 15:36:58 +0000
committerGreg Kroah-Hartman <[email protected]>2025-04-25 14:01:56 +0000
commitcec59c440a05c241846e8fe9d2575a2dafb56fd9 (patch)
treea7216443f4c042074eac1b9fc98b3141b02a2c06 /fs/kernfs/kernfs-internal.h
parentdriver core: auxiliary bus: Fix IS_ERR() vs NULL mixup in __devm_auxiliary_de... (diff)
downloadkernel-cec59c440a05c241846e8fe9d2575a2dafb56fd9.tar.gz
kernel-cec59c440a05c241846e8fe9d2575a2dafb56fd9.zip
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 <[email protected]> Acked-by: Tejun Heo <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
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;