]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - super1.c
Create: user container_dev rather than subarray for some tests.
[thirdparty/mdadm.git] / super1.c
index a52df6452b16f5c7e4d44052ddc298ca1b929058..6974daa0fb304cc26aa794b3e13550d771278efe 100644 (file)
--- a/super1.c
+++ b/super1.c
@@ -645,6 +645,18 @@ static void getinfo_super1(struct supertype *st, struct mdinfo *info, char *map)
        info->array.working_disks = working;
 }
 
+static struct mdinfo *container_content1(struct supertype *st, char *subarray)
+{
+       struct mdinfo *info;
+
+       if (subarray)
+               return NULL;
+
+       info = malloc(sizeof(*info));
+       getinfo_super1(st, info, NULL);
+       return info;
+}
+
 static int update_super1(struct supertype *st, struct mdinfo *info,
                         char *update,
                         char *devname, int verbose,
@@ -1205,9 +1217,6 @@ static int load_super1(struct supertype *st, int fd, char *devname)
 
        free_super1(st);
 
-       if (st->subarray[0])
-               return 1;
-
        if (st->ss == NULL || st->minor_version == -1) {
                int bestvers = -1;
                struct supertype tst;
@@ -1362,6 +1371,7 @@ static struct supertype *match_metadata_desc1(char *arg)
        if (!st) return st;
 
        memset(st, 0, sizeof(*st));
+       st->container_dev = NoMdDev;
        st->ss = &super1;
        st->max_devs = 384;
        st->sb = NULL;
@@ -1683,6 +1693,7 @@ struct superswitch super1 = {
        .match_home = match_home1,
        .uuid_from_super = uuid_from_super1,
        .getinfo_super = getinfo_super1,
+       .container_content = container_content1,
        .update_super = update_super1,
        .init_super = init_super1,
        .store_super = store_super1,