Replace all relevant occurrences of -4 with LEVEL_MULTIPATH
Also -1 -> LEVEL_LINEAR. Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
parent
672ca1b727
commit
df0d4ea04e
|
@ -683,7 +683,7 @@ int Assemble(struct supertype *st, char *mddev,
|
||||||
> devices[most_recent].i.events)
|
> devices[most_recent].i.events)
|
||||||
most_recent = devcnt;
|
most_recent = devcnt;
|
||||||
}
|
}
|
||||||
if (content->array.level == -4)
|
if (content->array.level == LEVEL_MULTIPATH)
|
||||||
/* with multipath, the raid_disk from the superblock is meaningless */
|
/* with multipath, the raid_disk from the superblock is meaningless */
|
||||||
i = devcnt;
|
i = devcnt;
|
||||||
else
|
else
|
||||||
|
@ -776,7 +776,7 @@ int Assemble(struct supertype *st, char *mddev,
|
||||||
/* note: we ignore error flags in multipath arrays
|
/* note: we ignore error flags in multipath arrays
|
||||||
* as they don't make sense
|
* 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_ACTIVE))) {
|
||||||
if (!(devices[j].i.disk.state
|
if (!(devices[j].i.disk.state
|
||||||
& (1<<MD_DISK_FAULTY)))
|
& (1<<MD_DISK_FAULTY)))
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
/* from readme.c */
|
/* from readme.c */
|
||||||
mapping_t pers[] = {
|
mapping_t pers[] = {
|
||||||
{ "linear", -1},
|
{ "linear", LEVEL_LINEAR},
|
||||||
{ "raid0", 0},
|
{ "raid0", 0},
|
||||||
{ "0", 0},
|
{ "0", 0},
|
||||||
{ "stripe", 0},
|
{ "stripe", 0},
|
||||||
|
@ -39,8 +39,8 @@ mapping_t pers[] = {
|
||||||
{ "4", 4},
|
{ "4", 4},
|
||||||
{ "raid5", 5},
|
{ "raid5", 5},
|
||||||
{ "5", 5},
|
{ "5", 5},
|
||||||
{ "multipath", -4},
|
{ "multipath", LEVEL_MULTIPATH},
|
||||||
{ "mp", -4},
|
{ "mp", LEVEL_MULTIPATH},
|
||||||
{ "raid6", 6},
|
{ "raid6", 6},
|
||||||
{ "6", 6},
|
{ "6", 6},
|
||||||
{ "raid10", 10},
|
{ "raid10", 10},
|
||||||
|
|
4
util.c
4
util.c
|
@ -261,9 +261,9 @@ int enough(int level, int raid_disks, int layout, int clean,
|
||||||
} while (first != 0);
|
} while (first != 0);
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
case -4:
|
case LEVEL_MULTIPATH:
|
||||||
return avail_disks>= 1;
|
return avail_disks>= 1;
|
||||||
case -1:
|
case LEVEL_LINEAR:
|
||||||
case 0:
|
case 0:
|
||||||
return avail_disks == raid_disks;
|
return avail_disks == raid_disks;
|
||||||
case 1:
|
case 1:
|
||||||
|
|
Loading…
Reference in New Issue