]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
super: convert s_count to refcount_t s_passive
authorChristian Brauner <brauner@kernel.org>
Tue, 16 Jun 2026 14:08:18 +0000 (16:08 +0200)
committerChristian Brauner <brauner@kernel.org>
Mon, 29 Jun 2026 08:31:51 +0000 (10:31 +0200)
commit3ec9800c2d33c783dd3b27d4cc3bb22b9385f828
treebc2a1541cab772a84afd79121249b0babe23ad0f
parentd152447614265750ead57816e2cc63c6116e35ec
super: convert s_count to refcount_t s_passive

The superblock carries two counters: s_active, the active reference
count that keeps the filesystem usable, and s_count, the passive
reference count that merely keeps the structure itself alive. Turn the
passive count into a refcount_t and rename it to s_passive to make the
pairing with s_active obvious.

Everything is still serialized by sb_lock, so there is no functional
change; the conversion buys the usual refcount_t saturation and
underflow checking. The following patches start dropping passive
references without holding sb_lock and make the device-to-superblock
table hold one passive reference per registered entry, which a plain
integer cannot support.

Link: https://patch.msgid.link/20260616-work-super-bdev_holder_global-v2-2-7df6b864028e@kernel.org
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
fs/super.c
include/linux/fs/super_types.h