aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/multipath.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/multipath.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/multipath.c')
-rw-r--r--drivers/md/multipath.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c
index 5899246fa37..a222f516660 100644
--- a/drivers/md/multipath.c
+++ b/drivers/md/multipath.c
@@ -292,17 +292,16 @@ static int multipath_add_disk(struct mddev *mddev, struct md_rdev *rdev)
292 return err; 292 return err;
293} 293}
294 294
295static int multipath_remove_disk(struct mddev *mddev, int number) 295static int multipath_remove_disk(struct mddev *mddev, struct md_rdev *rdev)
296{ 296{
297 struct mpconf *conf = mddev->private; 297 struct mpconf *conf = mddev->private;
298 int err = 0; 298 int err = 0;
299 struct md_rdev *rdev; 299 int number = rdev->raid_disk;
300 struct multipath_info *p = conf->multipaths + number; 300 struct multipath_info *p = conf->multipaths + number;
301 301
302 print_multipath_conf(conf); 302 print_multipath_conf(conf);
303 303
304 rdev = p->rdev; 304 if (rdev == p->rdev) {
305 if (rdev) {
306 if (test_bit(In_sync, &rdev->flags) || 305 if (test_bit(In_sync, &rdev->flags) ||
307 atomic_read(&rdev->nr_pending)) { 306 atomic_read(&rdev->nr_pending)) {
308 printk(KERN_ERR "hot-remove-disk, slot %d is identified" 307 printk(KERN_ERR "hot-remove-disk, slot %d is identified"