diff options
Diffstat (limited to 'drivers/md/multipath.c')
-rw-r--r-- | drivers/md/multipath.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c index 145cdc5ad008..e6aa309a66d7 100644 --- a/drivers/md/multipath.c +++ b/drivers/md/multipath.c | |||
@@ -35,15 +35,10 @@ | |||
35 | #define NR_RESERVED_BUFS 32 | 35 | #define NR_RESERVED_BUFS 32 |
36 | 36 | ||
37 | 37 | ||
38 | static mdk_personality_t multipath_personality; | ||
39 | |||
40 | |||
41 | static void *mp_pool_alloc(gfp_t gfp_flags, void *data) | 38 | static void *mp_pool_alloc(gfp_t gfp_flags, void *data) |
42 | { | 39 | { |
43 | struct multipath_bh *mpb; | 40 | struct multipath_bh *mpb; |
44 | mpb = kmalloc(sizeof(*mpb), gfp_flags); | 41 | mpb = kzalloc(sizeof(*mpb), gfp_flags); |
45 | if (mpb) | ||
46 | memset(mpb, 0, sizeof(*mpb)); | ||
47 | return mpb; | 42 | return mpb; |
48 | } | 43 | } |
49 | 44 | ||
@@ -444,7 +439,7 @@ static int multipath_run (mddev_t *mddev) | |||
444 | * should be freed in multipath_stop()] | 439 | * should be freed in multipath_stop()] |
445 | */ | 440 | */ |
446 | 441 | ||
447 | conf = kmalloc(sizeof(multipath_conf_t), GFP_KERNEL); | 442 | conf = kzalloc(sizeof(multipath_conf_t), GFP_KERNEL); |
448 | mddev->private = conf; | 443 | mddev->private = conf; |
449 | if (!conf) { | 444 | if (!conf) { |
450 | printk(KERN_ERR | 445 | printk(KERN_ERR |
@@ -452,9 +447,8 @@ static int multipath_run (mddev_t *mddev) | |||
452 | mdname(mddev)); | 447 | mdname(mddev)); |
453 | goto out; | 448 | goto out; |
454 | } | 449 | } |
455 | memset(conf, 0, sizeof(*conf)); | ||
456 | 450 | ||
457 | conf->multipaths = kmalloc(sizeof(struct multipath_info)*mddev->raid_disks, | 451 | conf->multipaths = kzalloc(sizeof(struct multipath_info)*mddev->raid_disks, |
458 | GFP_KERNEL); | 452 | GFP_KERNEL); |
459 | if (!conf->multipaths) { | 453 | if (!conf->multipaths) { |
460 | printk(KERN_ERR | 454 | printk(KERN_ERR |
@@ -462,7 +456,6 @@ static int multipath_run (mddev_t *mddev) | |||
462 | mdname(mddev)); | 456 | mdname(mddev)); |
463 | goto out_free_conf; | 457 | goto out_free_conf; |
464 | } | 458 | } |
465 | memset(conf->multipaths, 0, sizeof(struct multipath_info)*mddev->raid_disks); | ||
466 | 459 | ||
467 | conf->working_disks = 0; | 460 | conf->working_disks = 0; |
468 | ITERATE_RDEV(mddev,rdev,tmp) { | 461 | ITERATE_RDEV(mddev,rdev,tmp) { |
@@ -557,9 +550,10 @@ static int multipath_stop (mddev_t *mddev) | |||
557 | return 0; | 550 | return 0; |
558 | } | 551 | } |
559 | 552 | ||
560 | static mdk_personality_t multipath_personality= | 553 | static struct mdk_personality multipath_personality = |
561 | { | 554 | { |
562 | .name = "multipath", | 555 | .name = "multipath", |
556 | .level = LEVEL_MULTIPATH, | ||
563 | .owner = THIS_MODULE, | 557 | .owner = THIS_MODULE, |
564 | .make_request = multipath_make_request, | 558 | .make_request = multipath_make_request, |
565 | .run = multipath_run, | 559 | .run = multipath_run, |
@@ -572,15 +566,17 @@ static mdk_personality_t multipath_personality= | |||
572 | 566 | ||
573 | static int __init multipath_init (void) | 567 | static int __init multipath_init (void) |
574 | { | 568 | { |
575 | return register_md_personality (MULTIPATH, &multipath_personality); | 569 | return register_md_personality (&multipath_personality); |
576 | } | 570 | } |
577 | 571 | ||
578 | static void __exit multipath_exit (void) | 572 | static void __exit multipath_exit (void) |
579 | { | 573 | { |
580 | unregister_md_personality (MULTIPATH); | 574 | unregister_md_personality (&multipath_personality); |
581 | } | 575 | } |
582 | 576 | ||
583 | module_init(multipath_init); | 577 | module_init(multipath_init); |
584 | module_exit(multipath_exit); | 578 | module_exit(multipath_exit); |
585 | MODULE_LICENSE("GPL"); | 579 | MODULE_LICENSE("GPL"); |
586 | MODULE_ALIAS("md-personality-7"); /* MULTIPATH */ | 580 | MODULE_ALIAS("md-personality-7"); /* MULTIPATH */ |
581 | MODULE_ALIAS("md-multipath"); | ||
582 | MODULE_ALIAS("md-level--4"); | ||