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) ...@@ -1654,21 +1654,21 @@ static int do_md_run(mddev_t * mddev)
#undef TOO_BIG_CHUNKSIZE #undef TOO_BIG_CHUNKSIZE
#undef BAD_CHUNKSIZE #undef BAD_CHUNKSIZE
#define OUT(x) do { err = (x); goto out; } while (0)
static int restart_array(mddev_t *mddev) static int restart_array(mddev_t *mddev)
{ {
int err = 0; int err;
/* /*
* Complain if it has no devices * Complain if it has no devices
*/ */
err = -ENXIO;
if (list_empty(&mddev->disks)) if (list_empty(&mddev->disks))
OUT(-ENXIO); goto out;
if (mddev->pers) { if (mddev->pers) {
err = -EBUSY;
if (!mddev->ro) if (!mddev->ro)
OUT(-EBUSY); goto out;
mddev->ro = 0; mddev->ro = 0;
set_device_ro(mddev_to_kdev(mddev), 0); set_device_ro(mddev_to_kdev(mddev), 0);
...@@ -1681,6 +1681,7 @@ static int restart_array(mddev_t *mddev) ...@@ -1681,6 +1681,7 @@ static int restart_array(mddev_t *mddev)
md_recover_arrays(); md_recover_arrays();
if (mddev->pers->restart_resync) if (mddev->pers->restart_resync)
mddev->pers->restart_resync(mddev); mddev->pers->restart_resync(mddev);
err = 0;
} else { } else {
printk(KERN_ERR "md: md%d has no personality assigned.\n", printk(KERN_ERR "md: md%d has no personality assigned.\n",
mdidx(mddev)); mdidx(mddev));
...@@ -1703,7 +1704,8 @@ static int do_md_stop(mddev_t * mddev, int ro) ...@@ -1703,7 +1704,8 @@ static int do_md_stop(mddev_t * mddev, int ro)
if (atomic_read(&mddev->active)>1) { if (atomic_read(&mddev->active)>1) {
printk(STILL_IN_USE, mdidx(mddev)); printk(STILL_IN_USE, mdidx(mddev));
OUT(-EBUSY); err = -EBUSY;
goto out;
} }
if (mddev->pers) { if (mddev->pers) {
...@@ -1731,16 +1733,18 @@ static int do_md_stop(mddev_t * mddev, int ro) ...@@ -1731,16 +1733,18 @@ static int do_md_stop(mddev_t * mddev, int ro)
invalidate_device(dev, 1); invalidate_device(dev, 1);
if (ro) { if (ro) {
err = -ENXIO;
if (mddev->ro) if (mddev->ro)
OUT(-ENXIO); goto out;
mddev->ro = 1; mddev->ro = 1;
} else { } else {
if (mddev->ro) if (mddev->ro)
set_device_ro(dev, 0); set_device_ro(dev, 0);
if (mddev->pers->stop(mddev)) { if (mddev->pers->stop(mddev)) {
err = -EBUSY;
if (mddev->ro) if (mddev->ro)
set_device_ro(dev, 1); set_device_ro(dev, 1);
OUT(-EBUSY); goto out;
} }
if (mddev->ro) if (mddev->ro)
mddev->ro = 0; mddev->ro = 0;
...@@ -1766,15 +1770,13 @@ static int do_md_stop(mddev_t * mddev, int ro) ...@@ -1766,15 +1770,13 @@ static int do_md_stop(mddev_t * mddev, int ro)
if (!ro) { if (!ro) {
printk(KERN_INFO "md: md%d stopped.\n", mdidx(mddev)); printk(KERN_INFO "md: md%d stopped.\n", mdidx(mddev));
free_mddev(mddev); free_mddev(mddev);
} else } else
printk(KERN_INFO "md: md%d switched to read-only mode.\n", mdidx(mddev)); printk(KERN_INFO "md: md%d switched to read-only mode.\n", mdidx(mddev));
err = 0;
out: out:
return err; return err;
} }
#undef OUT
/* /*
* We have to safely support old arrays too. * 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