Skip to content

Commit 0b56c4c

Browse files
committed
md: switch personalities faulty multipath to use md_submodule_head
JIRA: https://issues.redhat.com/browse/RHEL-83988 Upstream status: RHEL-Only 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. Signed-off-by: Nigel Croxon <[email protected]>
1 parent 9cd1a16 commit 0b56c4c

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

drivers/md/md-faulty.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
#define MaxFault 50
5656
#include <linux/blkdev.h>
5757
#include <linux/module.h>
58-
#include <linux/raid/md_u.h>
5958
#include <linux/slab.h>
6059
#include "md.h"
6160
#include <linux/seq_file.h>
@@ -350,9 +349,13 @@ static void faulty_free(struct mddev *mddev, void *priv)
350349

351350
static struct md_personality faulty_personality =
352351
{
353-
.name = "faulty",
354-
.level = LEVEL_FAULTY,
355-
.owner = THIS_MODULE,
352+
.head = {
353+
.type = MD_PERSONALITY,
354+
.id = ID_FAULTY,
355+
.name = "faulty",
356+
.owner = THIS_MODULE,
357+
},
358+
356359
.make_request = faulty_make_request,
357360
.run = faulty_run,
358361
.free = faulty_free,
@@ -363,12 +366,12 @@ static struct md_personality faulty_personality =
363366

364367
static int __init raid_init(void)
365368
{
366-
return register_md_personality(&faulty_personality);
369+
return register_md_submodule(&faulty_personality.head);
367370
}
368371

369372
static void raid_exit(void)
370373
{
371-
unregister_md_personality(&faulty_personality);
374+
unregister_md_submodule(&faulty_personality.head);
372375
}
373376

374377
module_init(raid_init);

drivers/md/md-multipath.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
#include <linux/blkdev.h>
1515
#include <linux/module.h>
16-
#include <linux/raid/md_u.h>
1716
#include <linux/seq_file.h>
1817
#include <linux/slab.h>
1918
#include "md.h"
@@ -430,9 +429,12 @@ static void multipath_free(struct mddev *mddev, void *priv)
430429

431430
static struct md_personality multipath_personality =
432431
{
433-
.name = "multipath",
434-
.level = LEVEL_MULTIPATH,
435-
.owner = THIS_MODULE,
432+
.head = {
433+
.type = MD_PERSONALITY,
434+
.id = ID_MULTIPATH,
435+
.name = "multipath",
436+
.owner = THIS_MODULE,
437+
},
436438
.make_request = multipath_make_request,
437439
.run = multipath_run,
438440
.free = multipath_free,
@@ -445,12 +447,12 @@ static struct md_personality multipath_personality =
445447

446448
static int __init multipath_init (void)
447449
{
448-
return register_md_personality (&multipath_personality);
450+
return register_md_submodule(&multipath_personality.head);
449451
}
450452

451453
static void __exit multipath_exit (void)
452454
{
453-
unregister_md_personality (&multipath_personality);
455+
unregister_md_submodule(&multipath_personality.head);
454456
}
455457

456458
module_init(multipath_init);

drivers/md/md.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ enum md_submodule_type {
3131

3232
enum md_submodule_id {
3333
ID_LINEAR = LEVEL_LINEAR,
34+
ID_FAULTY = LEVEL_FAULTY,
35+
ID_MULTIPATH = LEVEL_MULTIPATH,
3436
ID_RAID0 = 0,
3537
ID_RAID1 = 1,
3638
ID_RAID4 = 4,

0 commit comments

Comments
 (0)