summaryrefslogtreecommitdiffstats
path: root/drivers/md/raid10.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-12-23 10:17:51 +1100
committerNeilBrown <neilb@suse.de>2011-12-23 10:17:51 +1100
commitb8321b68d1445f308324517e45fb0a5c2b48e271 (patch)
tree3fc4c9b253435753d2154d9bd697a7869163c29a /drivers/md/raid10.c
parent476a7abb9b00adfe6bf70e82800367319ab8078b (diff)
downloadlinux-stable-b8321b68d1445f308324517e45fb0a5c2b48e271.tar.gz
linux-stable-b8321b68d1445f308324517e45fb0a5c2b48e271.tar.bz2
linux-stable-b8321b68d1445f308324517e45fb0a5c2b48e271.zip
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/raid10.c')
-rw-r--r--drivers/md/raid10.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 685ddf325ee4..f5088dda4dca 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -1385,16 +1385,15 @@ static int raid10_add_disk(struct mddev *mddev, struct md_rdev *rdev)
return err;
}
-static int raid10_remove_disk(struct mddev *mddev, int number)
+static int raid10_remove_disk(struct mddev *mddev, struct md_rdev *rdev)
{
struct r10conf *conf = mddev->private;
int err = 0;
- struct md_rdev *rdev;
+ int number = rdev->raid_disk;
struct mirror_info *p = conf->mirrors+ number;
print_conf(conf);
- rdev = p->rdev;
- if (rdev) {
+ if (rdev == p->rdev) {
if (test_bit(In_sync, &rdev->flags) ||
atomic_read(&rdev->nr_pending)) {
err = -EBUSY;