aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid1.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/raid1.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/raid1.c')
-rw-r--r--drivers/md/raid1.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index ede2461e79c5..4317f8de143a 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1327,16 +1327,15 @@ static int raid1_add_disk(struct mddev *mddev, struct md_rdev *rdev)
1327 return err; 1327 return err;
1328} 1328}
1329 1329
1330static int raid1_remove_disk(struct mddev *mddev, int number) 1330static int raid1_remove_disk(struct mddev *mddev, struct md_rdev *rdev)
1331{ 1331{
1332 struct r1conf *conf = mddev->private; 1332 struct r1conf *conf = mddev->private;
1333 int err = 0; 1333 int err = 0;
1334 struct md_rdev *rdev; 1334 int number = rdev->raid_disk;
1335 struct mirror_info *p = conf->mirrors+ number; 1335 struct mirror_info *p = conf->mirrors+ number;
1336 1336
1337 print_conf(conf); 1337 print_conf(conf);
1338 rdev = p->rdev; 1338 if (rdev == p->rdev) {
1339 if (rdev) {
1340 if (test_bit(In_sync, &rdev->flags) || 1339 if (test_bit(In_sync, &rdev->flags) ||
1341 atomic_read(&rdev->nr_pending)) { 1340 atomic_read(&rdev->nr_pending)) {
1342 err = -EBUSY; 1341 err = -EBUSY;