]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - super-ddf.c
mdadm: replace container level checking with inline
[thirdparty/mdadm.git] / super-ddf.c
index 949e7d15547466701ffc39d507002fb2fb4f87b1..9d1e3b940df4d6f0b046a32de82255534c095ef4 100644 (file)
@@ -3325,7 +3325,7 @@ validate_geometry_ddf_container(struct supertype *st,
        int fd;
        unsigned long long ldsize;
 
-       if (level != LEVEL_CONTAINER)
+       if (!is_container(level))
                return 0;
        if (!dev)
                return 1;
@@ -3371,7 +3371,7 @@ static int validate_geometry_ddf(struct supertype *st,
 
        if (level == LEVEL_NONE)
                level = LEVEL_CONTAINER;
-       if (level == LEVEL_CONTAINER) {
+       if (is_container(level)) {
                /* Must be a fresh device to add to a container */
                return validate_geometry_ddf_container(st, level, raiddisks,
                                                       data_offset, dev,
@@ -3488,7 +3488,7 @@ static int validate_geometry_ddf_bvd(struct supertype *st,
        struct dl *dl;
        unsigned long long maxsize;
        /* ddf/bvd supports lots of things, but not containers */
-       if (level == LEVEL_CONTAINER) {
+       if (is_container(level)) {
                if (verbose)
                        pr_err("DDF cannot create a container within an container\n");
                return 0;