]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - mdadm.c
Remove lots of unnecessary white space.
[thirdparty/mdadm.git] / mdadm.c
diff --git a/mdadm.c b/mdadm.c
index 928d880bab64777a06e6af46d9afacf2bfd9b819..3324a9b2db8d6b1fbec247ec7e334dc5d1e633fb 100644 (file)
--- a/mdadm.c
+++ b/mdadm.c
@@ -29,7 +29,6 @@
 #include "md_p.h"
 #include <ctype.h>
 
-
 static int scan_assemble(struct supertype *ss,
                         struct context *c,
                         struct mddev_ident *ident);
@@ -40,7 +39,6 @@ static int misc_list(struct mddev_dev *devlist,
                     char *dump_directory,
                     struct supertype *ss, struct context *c);
 
-
 int main(int argc, char *argv[])
 {
        int mode = 0;
@@ -423,7 +421,6 @@ int main(int argc, char *argv[])
                        writemostly = 2;
                        continue;
 
-
                case O(GROW,'z'):
                case O(CREATE,'z'):
                case O(BUILD,'z'): /* size */
@@ -1301,8 +1298,10 @@ int main(int argc, char *argv[])
                                            c.update, c.force);
                if (!rv && c.readonly < 0)
                        rv = Manage_ro(devlist->devname, mdfd, c.readonly);
-               if (!rv && c.runstop)
-                       rv = Manage_runstop(devlist->devname, mdfd, c.runstop, c.verbose, 0);
+               if (!rv && c.runstop > 0)
+                       rv = Manage_run(devlist->devname, mdfd, c.verbose);
+               if (!rv && c.runstop < 0)
+                       rv = Manage_stop(devlist->devname, mdfd, c.verbose, 0);
                break;
        case ASSEMBLE:
                if (devs_found == 1 && ident.uuid_set == 0 &&
@@ -1609,7 +1608,7 @@ static int scan_assemble(struct supertype *ss,
                        if (a->devname &&
                            strcasecmp(a->devname, "<ignore>") == 0)
                                continue;
-                               
+
                        r = Assemble(ss, a->devname,
                                     a, NULL, c);
                        if (r == 0) {
@@ -1727,7 +1726,7 @@ static int stop_scan(int verbose)
                        }
                        mdfd = open_mddev(name, 1);
                        if (mdfd >= 0) {
-                               if (Manage_runstop(name, mdfd, -1, verbose, !last))
+                               if (Manage_stop(name, mdfd, verbose, !last))
                                        err = 1;
                                else
                                        progress = 1;
@@ -1801,13 +1800,19 @@ static int misc_list(struct mddev_dev *devlist,
                                               (dv == devlist && dv->next == NULL));
                        continue;
                }
-               mdfd = open_mddev(dv->devname, 1);
+               if (dv->devname[0] == '/')
+                       mdfd = open_mddev(dv->devname, 1);
+               else {
+                       mdfd = open_dev(dv->devname);
+                       if (mdfd < 0)
+                               pr_err("Cannot open %s\n", dv->devname);
+               }
                if (mdfd>=0) {
                        switch(dv->disposition) {
                        case 'R':
-                               rv |= Manage_runstop(dv->devname, mdfd, 1, c->verbose, 0); break;
+                               rv |= Manage_run(dv->devname, mdfd, c->verbose); break;
                        case 'S':
-                               rv |= Manage_runstop(dv->devname, mdfd, -1, c->verbose, 0); break;
+                               rv |= Manage_stop(dv->devname, mdfd, c->verbose, 0); break;
                        case 'o':
                                rv |= Manage_ro(dv->devname, mdfd, 1); break;
                        case 'w':