]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - mdadm.c
Create: default to bitmap=internal for large arrays.
[thirdparty/mdadm.git] / mdadm.c
diff --git a/mdadm.c b/mdadm.c
index 26e8ceca164097fe11ea2f3ce29b65c781d5b43a..c4c5f2948d950104983cb74f61abdf08bc83dd06 100644 (file)
--- a/mdadm.c
+++ b/mdadm.c
@@ -116,6 +116,13 @@ int main(int argc, char *argv[])
        ident.container = NULL;
        ident.member = NULL;
 
+       /*
+        * set first char of argv[0] to @. This is used by
+        * systemd to signal that the task was launched from
+        * initrd/initramfs and should be preserved during shutdown
+        */
+       argv[0][0] = '@';
+
        while ((option_index = -1) ,
               (opt=getopt_long(argc, argv,
                                shortopt, long_options,
@@ -159,14 +166,8 @@ int main(int argc, char *argv[])
                                c.homehost = optarg;
                        continue;
 
-               /*
-                * --offroot sets first char of argv[0] to @. This is used
-                * by systemd to signal that the task was launched from
-                * initrd/initramfs and should be preserved during shutdown
-                */
                case OffRootOpt:
-                       argv[0][0] = '@';
-                       __offroot = 1;
+                       /* Silently ignore old option */
                        continue;
 
                case Prefer:
@@ -1078,12 +1079,6 @@ int main(int argc, char *argv[])
                case O(BUILD,Bitmap):
                case O(CREATE,'b'):
                case O(CREATE,Bitmap): /* here we create the bitmap */
-                       if (strcmp(optarg, "none") == 0) {
-                               pr_err("'--bitmap none' only"
-                                       " supported for --grow\n");
-                               exit(2);
-                       }
-                       /* FALL THROUGH */
                case O(GROW,'b'):
                case O(GROW,Bitmap):
                        if (strcmp(optarg, "internal")== 0 ||
@@ -1456,7 +1451,7 @@ int main(int argc, char *argv[])
                                rv = 1;
                                break;
                        }
-                       sysfs_init(&sra, mdfd, 0);
+                       sysfs_init(&sra, mdfd, NULL);
                        if (array_size == MAX_SIZE)
                                err = sysfs_set_str(&sra, NULL, "array_size", "default");
                        else
@@ -1657,12 +1652,12 @@ static int misc_scan(char devmode, struct context *c)
                                        "external:/", 10) == 0;
                        if (members != member)
                                continue;
-                       me = map_by_devnum(&map, e->devnum);
+                       me = map_by_devnm(&map, e->devnm);
                        if (me && me->path
                            && strcmp(me->path, "/unknown") != 0)
                                name = me->path;
                        else
-                               name = get_md_name(e->devnum);
+                               name = get_md_name(e->devnm);
 
                        if (!name) {
                                pr_err("cannot find device file for %s\n",
@@ -1696,7 +1691,7 @@ static int stop_scan(int verbose)
                if (!progress) last = 1;
                progress = 0; err = 0;
                for (e=ms ; e ; e=e->next) {
-                       char *name = get_md_name(e->devnum);
+                       char *name = get_md_name(e->devnm);
                        int mdfd;
 
                        if (!name) {