]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Create.c
mdadm: replace container level checking with inline
[thirdparty/mdadm.git] / Create.c
index e06ec2ae96a1049546a877a40adb193bd79cb99e..953e73722518b1fe5c36c3a4748bf70fcbbc9dd3 100644 (file)
--- a/Create.c
+++ b/Create.c
@@ -487,7 +487,7 @@ int Create(struct supertype *st, char *mddev,
                            st->minor_version >= 1)
                                /* metadata at front */
                                warn |= check_partitions(fd, dname, 0, 0);
-                       else if (s->level == 1 || s->level == LEVEL_CONTAINER ||
+                       else if (s->level == 1 || is_container(s->level) ||
                                 (s->level == 0 && s->raiddisks == 1))
                                /* partitions could be meaningful */
                                warn |= check_partitions(fd, dname, freesize*2, s->size*2);
@@ -997,7 +997,7 @@ int Create(struct supertype *st, char *mddev,
                         * again returns container info.
                         */
                        st->ss->getinfo_super(st, &info_new, NULL);
-                       if (st->ss->external && s->level != LEVEL_CONTAINER &&
+                       if (st->ss->external && !is_container(s->level) &&
                            !same_uuid(info_new.uuid, info.uuid, 0)) {
                                map_update(&map, fd2devnm(mdfd),
                                           info_new.text_version,
@@ -1040,7 +1040,7 @@ int Create(struct supertype *st, char *mddev,
        map_unlock(&map);
        free(infos);
 
-       if (s->level == LEVEL_CONTAINER) {
+       if (is_container(s->level)) {
                /* No need to start.  But we should signal udev to
                 * create links */
                sysfs_uevent(&info, "change");