aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/multipath.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2006-01-06 03:20:36 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-06 11:34:06 -0500
commit2604b703b6b3db80e3c75ce472a54dfd0b7bf9f4 (patch)
tree8c0e985c455ff35af24fbe60d8a3f5a276034370 /drivers/md/multipath.c
parenta24a8dd858e0ba50f06a9fd8f61fe8c4fe7a8d8e (diff)
[PATCH] md: remove personality numbering from md
md supports multiple different RAID level, each being implemented by a 'personality' (which is often in a separate module). These personalities have fairly artificial 'numbers'. The numbers are use to: 1- provide an index into an array where the various personalities are recorded 2- identify the module (via an alias) which implements are particular personality. Neither of these uses really justify the existence of personality numbers. The array can be replaced by a linked list which is searched (array lookup only happens very rarely). Module identification can be done using an alias based on level rather than 'personality' number. The current 'raid5' modules support two level (4 and 5) but only one personality. This slight awkwardness (which was handled in the mapping from level to personality) can be better handled by allowing raid5 to register 2 personalities. With this change in place, the core md module does not need to have an exhaustive list of all possible personalities, so other personalities can be added independently. This patch also moves the check for chunksize being non-zero into the ->run routines for the personalities that need it, rather than having it in core-md. This has a side effect of allowing 'faulty' and 'linear' not to have a chunk-size set. Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/md/multipath.c')
-rw-r--r--drivers/md/multipath.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c
index 97a56aaaef6d..d4d838e3f9f8 100644
--- a/drivers/md/multipath.c
+++ b/drivers/md/multipath.c
@@ -35,9 +35,6 @@
35#define NR_RESERVED_BUFS 32 35#define NR_RESERVED_BUFS 32
36 36
37 37
38static mdk_personality_t multipath_personality;
39
40
41static void *mp_pool_alloc(gfp_t gfp_flags, void *data) 38static void *mp_pool_alloc(gfp_t gfp_flags, void *data)
42{ 39{
43 struct multipath_bh *mpb; 40 struct multipath_bh *mpb;
@@ -553,9 +550,10 @@ static int multipath_stop (mddev_t *mddev)
553 return 0; 550 return 0;
554} 551}
555 552
556static mdk_personality_t multipath_personality= 553static struct mdk_personality multipath_personality =
557{ 554{
558 .name = "multipath", 555 .name = "multipath",
556 .level = LEVEL_MULTIPATH,
559 .owner = THIS_MODULE, 557 .owner = THIS_MODULE,
560 .make_request = multipath_make_request, 558 .make_request = multipath_make_request,
561 .run = multipath_run, 559 .run = multipath_run,
@@ -568,15 +566,16 @@ static mdk_personality_t multipath_personality=
568 566
569static int __init multipath_init (void) 567static int __init multipath_init (void)
570{ 568{
571 return register_md_personality (MULTIPATH, &multipath_personality); 569 return register_md_personality (&multipath_personality);
572} 570}
573 571
574static void __exit multipath_exit (void) 572static void __exit multipath_exit (void)
575{ 573{
576 unregister_md_personality (MULTIPATH); 574 unregister_md_personality (&multipath_personality);
577} 575}
578 576
579module_init(multipath_init); 577module_init(multipath_init);
580module_exit(multipath_exit); 578module_exit(multipath_exit);
581MODULE_LICENSE("GPL"); 579MODULE_LICENSE("GPL");
582MODULE_ALIAS("md-personality-7"); /* MULTIPATH */ 580MODULE_ALIAS("md-personality-7"); /* MULTIPATH */
581MODULE_ALIAS("md-level--4");