diff options
author | NeilBrown <neilb@suse.de> | 2012-07-09 09:19:48 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-07-09 09:19:48 +0200 |
commit | 265460ababa169a2a0926b5fba10724ba117e318 (patch) | |
tree | 06718d59a40d6f6e318e53150f841894bd4e343c | |
parent | Change Create to take a struct context (diff) | |
download | mdadm-265460ababa169a2a0926b5fba10724ba117e318.tar.xz mdadm-265460ababa169a2a0926b5fba10724ba117e318.zip |
Examine: split 'verbose' out from 'brief'.
The value of 'verbose' is sometimes mixed into 'brief', particularly
for Examine.
This is messy and confusing. So keep them separate.
'brief' still gets assumed when 'scan' is set, unless we are very
verbose.
Signed-off-by: NeilBrown <neilb@suse.de>
-rw-r--r-- | Examine.c | 11 | ||||
-rw-r--r-- | mdadm.c | 8 | ||||
-rw-r--r-- | mdadm.h | 2 |
3 files changed, 12 insertions, 9 deletions
@@ -30,7 +30,8 @@ #endif #include "md_u.h" #include "md_p.h" -int Examine(struct mddev_dev *devlist, int brief, int export, int scan, +int Examine(struct mddev_dev *devlist, int brief, int verbose, + int export, int scan, int SparcAdjust, struct supertype *forcest, char *homehost) { @@ -161,10 +162,10 @@ int Examine(struct mddev_dev *devlist, int brief, int export, int scan, char *d; int newline = 0; - ap->st->ss->brief_examine_super(ap->st, brief > 1); + ap->st->ss->brief_examine_super(ap->st, verbose > 0); if (ap->spares) newline += printf(" spares=%d", ap->spares); - if (brief > 1) { + if (verbose > 0) { newline += printf(" devices"); for (d=dl_next(ap->devs); d!= ap->devs; d=dl_next(d)) { printf("%c%s", sep, d); @@ -174,11 +175,11 @@ int Examine(struct mddev_dev *devlist, int brief, int export, int scan, if (ap->st->ss->brief_examine_subarrays) { if (newline) printf("\n"); - ap->st->ss->brief_examine_subarrays(ap->st, brief > 1); + ap->st->ss->brief_examine_subarrays(ap->st, verbose); } ap->st->ss->free_super(ap->st); /* FIXME free ap */ - if (ap->spares || brief > 1) + if (ap->spares || verbose > 0) printf("\n"); } } @@ -1221,6 +1221,10 @@ int main(int argc, char *argv[]) ident.autof = c.autof; + if (c.scan && c.verbose < 2) + /* --scan implied --brief unless -vv */ + c.brief = 1; + rv = 0; switch(mode) { case MANAGE: @@ -1350,9 +1354,7 @@ int main(int argc, char *argv[]) pr_err("No devices listed in %s\n", configfile?configfile:DefaultConfFile); exit(1); } - if (c.brief && c.verbose > 0) - c.brief = 2; - rv = Examine(devlist, c.scan?(c.verbose>1?0:c.verbose):c.brief, + rv = Examine(devlist, c.brief, c.verbose, c.export, c.scan, c.SparcAdjust, ss, c.homehost); } else if (devmode == DetailPlatform) { @@ -1116,7 +1116,7 @@ extern int Create(struct supertype *st, char *mddev, extern int Detail(char *dev, int brief, int export, int test, char *homehost, char *prefer); extern int Detail_Platform(struct superswitch *ss, int scan, int verbose); extern int Query(char *dev); -extern int Examine(struct mddev_dev *devlist, int brief, int export, int scan, +extern int Examine(struct mddev_dev *devlist, int brief, int verbose, int export, int scan, int SparcAdjust, struct supertype *forcest, char *homehost); extern int Monitor(struct mddev_dev *devlist, char *mailaddr, char *alert_cmd, |