summaryrefslogtreecommitdiffstats
path: root/drivers/md/multipath.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@notabene.brown>2008-06-28 08:31:33 +1000
committerNeil Brown <neilb@notabene.brown>2008-06-28 08:31:33 +1000
commit199050ea1ff2270174ee525b73bc4c3323098897 (patch)
treeb2a7851511b2ddb943b9ff7ce7c8a96c3ac2a8bb /drivers/md/multipath.c
parent6c2fce2ef6b4821c21b5c42c7207cb9cf8c87eda (diff)
downloadop-kernel-dev-199050ea1ff2270174ee525b73bc4c3323098897.zip
op-kernel-dev-199050ea1ff2270174ee525b73bc4c3323098897.tar.gz
rationalise return value for ->hot_add_disk method.
For all array types but linear, ->hot_add_disk returns 1 on success, 0 on failure. For linear, it returns 0 on success and -errno on failure. This doesn't cause a functional problem because the ->hot_add_disk function of linear is used quite differently to the others. However it is confusing. So convert all to return 0 for success or -errno on failure and fix call sites to match. Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'drivers/md/multipath.c')
-rw-r--r--drivers/md/multipath.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c
index 4a1d714..541cbe3 100644
--- a/drivers/md/multipath.c
+++ b/drivers/md/multipath.c
@@ -281,7 +281,7 @@ static int multipath_add_disk(mddev_t *mddev, mdk_rdev_t *rdev)
{
multipath_conf_t *conf = mddev->private;
struct request_queue *q;
- int found = 0;
+ int err = -EEXIST;
int path;
struct multipath_info *p;
int first = 0;
@@ -312,11 +312,13 @@ static int multipath_add_disk(mddev_t *mddev, mdk_rdev_t *rdev)
rdev->raid_disk = path;
set_bit(In_sync, &rdev->flags);
rcu_assign_pointer(p->rdev, rdev);
- found = 1;
+ err = 0;
+ break;
}
print_multipath_conf(conf);
- return found;
+
+ return err;
}
static int multipath_remove_disk(mddev_t *mddev, int number)
OpenPOWER on IntegriCloud