mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
md: switch personalities to use md_submodule_head
Remove the global list 'pers_list', and switch to use md_submodule_head, which is managed by xarry. Prepare to unify registration and unregistration for all sub modules. Link: https://lore.kernel.org/linux-raid/20250215092225.2427977-5-yukuai1@huaweicloud.com Signed-off-by: Yu Kuai <yukuai3@huawei.com>
This commit is contained in:
@@ -3500,9 +3500,13 @@ static void *raid1_takeover(struct mddev *mddev)
|
||||
|
||||
static struct md_personality raid1_personality =
|
||||
{
|
||||
.name = "raid1",
|
||||
.level = 1,
|
||||
.owner = THIS_MODULE,
|
||||
.head = {
|
||||
.type = MD_PERSONALITY,
|
||||
.id = ID_RAID1,
|
||||
.name = "raid1",
|
||||
.owner = THIS_MODULE,
|
||||
},
|
||||
|
||||
.make_request = raid1_make_request,
|
||||
.run = raid1_run,
|
||||
.free = raid1_free,
|
||||
@@ -3519,18 +3523,18 @@ static struct md_personality raid1_personality =
|
||||
.takeover = raid1_takeover,
|
||||
};
|
||||
|
||||
static int __init raid_init(void)
|
||||
static int __init raid1_init(void)
|
||||
{
|
||||
return register_md_personality(&raid1_personality);
|
||||
return register_md_submodule(&raid1_personality.head);
|
||||
}
|
||||
|
||||
static void raid_exit(void)
|
||||
static void __exit raid1_exit(void)
|
||||
{
|
||||
unregister_md_personality(&raid1_personality);
|
||||
unregister_md_submodule(&raid1_personality.head);
|
||||
}
|
||||
|
||||
module_init(raid_init);
|
||||
module_exit(raid_exit);
|
||||
module_init(raid1_init);
|
||||
module_exit(raid1_exit);
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_DESCRIPTION("RAID1 (mirroring) personality for MD");
|
||||
MODULE_ALIAS("md-personality-3"); /* RAID1 */
|
||||
|
||||
Reference in New Issue
Block a user