]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
md/md-bitmap: split bitmap sysfs groups
authorYu Kuai <yukuai@fnnas.com>
Sat, 25 Apr 2026 02:46:14 +0000 (10:46 +0800)
committerYu Kuai <yukuai@fnnas.com>
Tue, 28 Apr 2026 12:44:37 +0000 (20:44 +0800)
commitaba3d6d6cb55c6e1116d1215140559dd7ecdf9a9
treecd1dad03d3c51bfaecc6ef542bef0884d7b4dd58
parent8776d342cf8fa0b98ca5e6fb2d956966fb5ca364
md/md-bitmap: split bitmap sysfs groups

Split the classic bitmap sysfs files into a common bitmap group with
the location attribute and a separate internal bitmap group for the
remaining files.

At the same time, convert bitmap operations from a single sysfs group
to a sysfs group array so backends can share part of their sysfs
layout while adding backend-specific attributes separately.

Switch the bitmap sysfs helpers to use sysfs_update_groups() for the
add and update path, and remove groups in reverse order so shared named
groups are unmerged before the last group removes the directory.

Also make bitmap operation lookup depend only on the currently selected
bitmap id matching the installed backend. This prepares the lookup path
for a later registered none backend.

Reviewed-by: Su Yue <glass.su@suse.com>
Link: https://lore.kernel.org/r/20260425024615.1696892-3-yukuai@fnnas.com
Signed-off-by: Yu Kuai <yukuai@fnnas.com>
drivers/md/md-bitmap.c
drivers/md/md-bitmap.h
drivers/md/md-llbitmap.c
drivers/md/md.c