summaryrefslogtreecommitdiffstats
path: root/mdadm.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2005-08-15 06:14:27 +0000
committerNeil Brown <neilb@suse.de>2005-08-15 06:14:27 +0000
commitdab6685f3d9982b697d938d99737897ea8ac768c (patch)
treef68788b7c36feabc151e96d622dffd44644fbbac /mdadm.c
parent7358e196679a5fba3f447c26c7133cba2aa44928 (diff)
downloadmdadm-dab6685f3d9982b697d938d99737897ea8ac768c.tar.gz
mdadm-dab6685f3d9982b697d938d99737897ea8ac768c.tar.xz
mdadm-dab6685f3d9982b697d938d99737897ea8ac768c.zip
Add 'quite' option and tidy up some tests.
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
Diffstat (limited to 'mdadm.c')
-rw-r--r--mdadm.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/mdadm.c b/mdadm.c
index de1f95a..a24778e 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -70,6 +70,7 @@ int main(int argc, char *argv[])
mddev_dev_t dv;
int devs_found = 0;
int verbose = 0;
+ int quiet = 0;
int brief = 0;
int force = 0;
int test = 0;
@@ -114,7 +115,7 @@ int main(int argc, char *argv[])
short_options, long_options,
&option_index)) != -1) {
int newmode = mode;
- /* firstly, so mode-independant options */
+ /* firstly, some mode-independant options */
switch(opt) {
case 'h':
help_text = Help;
@@ -141,6 +142,9 @@ int main(int argc, char *argv[])
case 'v': verbose++;
continue;
+ case 'q': quiet++;
+ continue;
+
case 'b':
if (mode == ASSEMBLE || mode == BUILD || mode == CREATE || mode == GROW)
break; /* b means bitmap */
@@ -860,7 +864,7 @@ int main(int argc, char *argv[])
rv = Manage_ro(devlist->devname, mdfd, readonly);
if (!rv && devs_found>1)
rv = Manage_subdevs(devlist->devname, mdfd,
- devlist->next);
+ devlist->next, verbose-quiet);
if (!rv && readonly < 0)
rv = Manage_ro(devlist->devname, mdfd, readonly);
if (!rv && runstop)
@@ -883,14 +887,14 @@ int main(int argc, char *argv[])
else {
rv |= Assemble(ss, devlist->devname, mdfd, array_ident, configfile,
NULL,
- readonly, runstop, update, verbose, force);
+ readonly, runstop, update, verbose-quiet, force);
close(mdfd);
}
}
} else if (!scan)
rv = Assemble(ss, devlist->devname, mdfd, &ident, configfile,
devlist->next,
- readonly, runstop, update, verbose, force);
+ readonly, runstop, update, verbose-quiet, force);
else if (devs_found>0) {
if (update && devs_found > 1) {
fprintf(stderr, Name ": can only update a single array at a time\n");
@@ -912,7 +916,7 @@ int main(int argc, char *argv[])
}
rv |= Assemble(ss, dv->devname, mdfd, array_ident, configfile,
NULL,
- readonly, runstop, update, verbose, force);
+ readonly, runstop, update, verbose-quiet, force);
close(mdfd);
}
} else {
@@ -936,7 +940,7 @@ int main(int argc, char *argv[])
rv |= Assemble(ss, array_list->devname, mdfd,
array_list, configfile,
NULL,
- readonly, runstop, NULL, verbose, force);
+ readonly, runstop, NULL, verbose-quiet, force);
close(mdfd);
}
}
@@ -969,7 +973,7 @@ int main(int argc, char *argv[])
}
rv = Build(devlist->devname, mdfd, chunk, level, layout,
raiddisks, devlist->next, assume_clean,
- bitmap_file, bitmap_chunk, write_behind, delay);
+ bitmap_file, bitmap_chunk, write_behind, delay, verbose-quiet);
break;
case CREATE:
if (delay == 0) delay = DEFAULT_BITMAP_DELAY;
@@ -989,7 +993,7 @@ int main(int argc, char *argv[])
rv = Create(ss, devlist->devname, mdfd, chunk, level, layout, size<0 ? 0 : size,
raiddisks, sparedisks, ident.name,
- devs_found-1, devlist->next, runstop, verbose, force,
+ devs_found-1, devlist->next, runstop, verbose-quiet, force,
bitmap_file, bitmap_chunk, write_behind, delay);
break;
case MISC: