]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Replace all relevant occurrences of -4 with LEVEL_MULTIPATH
authorNeilBrown <neilb@suse.de>
Tue, 17 Nov 2009 01:31:12 +0000 (12:31 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 17 Nov 2009 01:31:12 +0000 (12:31 +1100)
Also -1 -> LEVEL_LINEAR.

Signed-off-by: NeilBrown <neilb@suse.de>
Assemble.c
mdassemble.c
util.c

index a16cafe2c5be0c5f3cbc327faf8e207e79d2cd3d..e1870fc5ab44961654c2d57a6a0d85709da75874 100644 (file)
@@ -683,7 +683,7 @@ int Assemble(struct supertype *st, char *mddev,
                            > devices[most_recent].i.events)
                                most_recent = devcnt;
                }
-               if (content->array.level == -4)
+               if (content->array.level == LEVEL_MULTIPATH)
                        /* with multipath, the raid_disk from the superblock is meaningless */
                        i = devcnt;
                else
@@ -776,7 +776,7 @@ int Assemble(struct supertype *st, char *mddev,
                /* note: we ignore error flags in multipath arrays
                 * as they don't make sense
                 */
-               if (content->array.level != -4)
+               if (content->array.level != LEVEL_MULTIPATH)
                        if (!(devices[j].i.disk.state & (1<<MD_DISK_ACTIVE))) {
                                if (!(devices[j].i.disk.state
                                      & (1<<MD_DISK_FAULTY)))
index cf83795789158a28e41f441dac40dd060f067681..d0d0707e123412b6233fad96285ad6eb8114c137 100644 (file)
@@ -28,7 +28,7 @@
 
 /* from readme.c */
 mapping_t pers[] = {
-       { "linear", -1},
+       { "linear", LEVEL_LINEAR},
        { "raid0", 0},
        { "0", 0},
        { "stripe", 0},
@@ -39,8 +39,8 @@ mapping_t pers[] = {
        { "4", 4},
        { "raid5", 5},
        { "5", 5},
-       { "multipath", -4},
-       { "mp", -4},
+       { "multipath", LEVEL_MULTIPATH},
+       { "mp", LEVEL_MULTIPATH},
        { "raid6", 6},
        { "6", 6},
        { "raid10", 10},
diff --git a/util.c b/util.c
index 048c39f6c69b1d7de7dffb4a5c07edd575350e2f..a0e4bcf0aac94e46c9995523ebead1b06a2b7131 100644 (file)
--- a/util.c
+++ b/util.c
@@ -261,9 +261,9 @@ int enough(int level, int raid_disks, int layout, int clean,
                } while (first != 0);
                return 1;
 
-       case -4:
+       case LEVEL_MULTIPATH:
                return avail_disks>= 1;
-       case -1:
+       case LEVEL_LINEAR:
        case 0:
                return avail_disks == raid_disks;
        case 1: