summaryrefslogtreecommitdiffstats
path: root/mdadm.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2005-05-03 23:44:40 +0000
committerNeil Brown <neilb@suse.de>2005-05-03 23:44:40 +0000
commit82d9eba687c952a9919f756203706285d6c42f07 (patch)
tree53d8a29cc1e532aa0f05f888cfd6603dd9f4715f /mdadm.c
parentf9ce90ba509d0b624cc38635861b9c27550fbefc (diff)
downloadmdadm-82d9eba687c952a9919f756203706285d6c42f07.tar.gz
mdadm-82d9eba687c952a9919f756203706285d6c42f07.tar.xz
mdadm-82d9eba687c952a9919f756203706285d6c42f07.zip
super1
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Fix raid5 creation with new code. Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
Diffstat (limited to 'mdadm.c')
-rw-r--r--mdadm.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/mdadm.c b/mdadm.c
index b738fad..1bdc55d 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -81,7 +81,7 @@ int main(int argc, char *argv[])
int daemonise = 0;
char *pidfile = NULL;
int oneshot = 0;
- struct superswitch *ss = NULL;
+ struct supertype *ss = NULL;
int copies;
@@ -281,11 +281,9 @@ int main(int argc, char *argv[])
fprintf(stderr, Name ": metadata information already given\n");
exit(2);
}
- for(i=0; superlist[i]; i++)
- if (superlist[i]->match_metadata_desc(optarg)) {
- ss = superlist[i];
- break;
- }
+ for(i=0; !ss && superlist[i]; i++)
+ ss = superlist[i]->match_metadata_desc(optarg);
+
if (!ss) {
fprintf(stderr, Name ": unrecognised metadata identifier: %s\n", optarg);
exit(2);
@@ -818,11 +816,8 @@ int main(int argc, char *argv[])
break;
case CREATE:
if (ss == NULL) {
- for(i=0; superlist[i]; i++)
- if (superlist[i]->match_metadata_desc("default")) {
- ss = superlist[i];
- break;
- }
+ for(i=0; !ss && superlist[i]; i++)
+ ss = superlist[i]->match_metadata_desc("default");
}
if (!ss) {
fprintf(stderr, Name ": internal error - no default metadata style\n");
@@ -846,7 +841,7 @@ int main(int argc, char *argv[])
fprintf(stderr, Name ": No devices listed in %s\n", configfile?configfile:DefaultConfFile);
exit(1);
}
- rv = Examine(devlist, scan?!verbose:brief, scan, SparcAdjust);
+ rv = Examine(devlist, scan?!verbose:brief, scan, SparcAdjust, ss);
} else {
if (devlist == NULL) {
if ((devmode == 'S' ||devmode=='D') && scan) {