Commit 8892097c authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] md 11 of 22 - Get rid of "OUT" macro in md.c

It doesn't really help clarity or brevity.
parent 2dc0a8b3
......@@ -1654,21 +1654,21 @@ static int do_md_run(mddev_t * mddev)
#undef TOO_BIG_CHUNKSIZE
#undef BAD_CHUNKSIZE
#define OUT(x) do { err = (x); goto out; } while (0)
static int restart_array(mddev_t *mddev)
{
int err = 0;
int err;
/*
* Complain if it has no devices
*/
err = -ENXIO;
if (list_empty(&mddev->disks))
OUT(-ENXIO);
goto out;
if (mddev->pers) {
err = -EBUSY;
if (!mddev->ro)
OUT(-EBUSY);
goto out;
mddev->ro = 0;
set_device_ro(mddev_to_kdev(mddev), 0);
......@@ -1681,6 +1681,7 @@ static int restart_array(mddev_t *mddev)
md_recover_arrays();
if (mddev->pers->restart_resync)
mddev->pers->restart_resync(mddev);
err = 0;
} else {
printk(KERN_ERR "md: md%d has no personality assigned.\n",
mdidx(mddev));
......@@ -1703,7 +1704,8 @@ static int do_md_stop(mddev_t * mddev, int ro)
if (atomic_read(&mddev->active)>1) {
printk(STILL_IN_USE, mdidx(mddev));
OUT(-EBUSY);
err = -EBUSY;
goto out;
}
if (mddev->pers) {
......@@ -1731,16 +1733,18 @@ static int do_md_stop(mddev_t * mddev, int ro)
invalidate_device(dev, 1);
if (ro) {
err = -ENXIO;
if (mddev->ro)
OUT(-ENXIO);
goto out;
mddev->ro = 1;
} else {
if (mddev->ro)
set_device_ro(dev, 0);
if (mddev->pers->stop(mddev)) {
err = -EBUSY;
if (mddev->ro)
set_device_ro(dev, 1);
OUT(-EBUSY);
goto out;
}
if (mddev->ro)
mddev->ro = 0;
......@@ -1766,15 +1770,13 @@ static int do_md_stop(mddev_t * mddev, int ro)
if (!ro) {
printk(KERN_INFO "md: md%d stopped.\n", mdidx(mddev));
free_mddev(mddev);
} else
printk(KERN_INFO "md: md%d switched to read-only mode.\n", mdidx(mddev));
err = 0;
out:
return err;
}
#undef OUT
/*
* We have to safely support old arrays too.
*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment