aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-12-22 18:17:51 -0500
committerNeilBrown <neilb@suse.de>2011-12-22 18:17:51 -0500
commitb8321b68d1445f308324517e45fb0a5c2b48e271 (patch)
tree3fc4c9b253435753d2154d9bd697a7869163c29a /drivers/md/md.c
parent476a7abb9b00adfe6bf70e82800367319ab8078b (diff)
md: change hot_remove_disk to take an rdev rather than a number.
Soon an array will be able to have multiple devices with the same raid_disk number (an original and a replacement). So removing a device based on the number won't work. So pass the actual device handle instead. Reviewed-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index d51c688d9c94..0e2288824938 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -2689,7 +2689,7 @@ slot_store(struct md_rdev *rdev, const char *buf, size_t len)
2689 if (rdev->mddev->pers->hot_remove_disk == NULL) 2689 if (rdev->mddev->pers->hot_remove_disk == NULL)
2690 return -EINVAL; 2690 return -EINVAL;
2691 err = rdev->mddev->pers-> 2691 err = rdev->mddev->pers->
2692 hot_remove_disk(rdev->mddev, rdev->raid_disk); 2692 hot_remove_disk(rdev->mddev, rdev);
2693 if (err) 2693 if (err)
2694 return err; 2694 return err;
2695 sysfs_unlink_rdev(rdev->mddev, rdev); 2695 sysfs_unlink_rdev(rdev->mddev, rdev);
@@ -7340,7 +7340,7 @@ static int remove_and_add_spares(struct mddev *mddev)
7340 ! test_bit(In_sync, &rdev->flags)) && 7340 ! test_bit(In_sync, &rdev->flags)) &&
7341 atomic_read(&rdev->nr_pending)==0) { 7341 atomic_read(&rdev->nr_pending)==0) {
7342 if (mddev->pers->hot_remove_disk( 7342 if (mddev->pers->hot_remove_disk(
7343 mddev, rdev->raid_disk)==0) { 7343 mddev, rdev) == 0) {
7344 sysfs_unlink_rdev(mddev, rdev); 7344 sysfs_unlink_rdev(mddev, rdev);
7345 rdev->raid_disk = -1; 7345 rdev->raid_disk = -1;
7346 } 7346 }
@@ -7477,7 +7477,7 @@ void md_check_recovery(struct mddev *mddev)
7477 test_bit(Faulty, &rdev->flags) && 7477 test_bit(Faulty, &rdev->flags) &&
7478 atomic_read(&rdev->nr_pending)==0) { 7478 atomic_read(&rdev->nr_pending)==0) {
7479 if (mddev->pers->hot_remove_disk( 7479 if (mddev->pers->hot_remove_disk(
7480 mddev, rdev->raid_disk)==0) { 7480 mddev, rdev) == 0) {
7481 sysfs_unlink_rdev(mddev, rdev); 7481 sysfs_unlink_rdev(mddev, rdev);
7482 rdev->raid_disk = -1; 7482 rdev->raid_disk = -1;
7483 } 7483 }