Examine: fixup output in the presence of containers with spares
If we dump any 'spare' or 'device' information for a container in the 'brief' case then we need a newline before printing member array info. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
parent
709743c554
commit
ee836c39b5
12
Examine.c
12
Examine.c
|
@ -136,17 +136,23 @@ int Examine(mddev_dev_t devlist, int brief, int export, int scan,
|
||||||
for (ap=arrays; ap; ap=ap->next) {
|
for (ap=arrays; ap; ap=ap->next) {
|
||||||
char sep='=';
|
char sep='=';
|
||||||
char *d;
|
char *d;
|
||||||
|
int newline = 0;
|
||||||
|
|
||||||
ap->st->ss->brief_examine_super(ap->st, brief > 1);
|
ap->st->ss->brief_examine_super(ap->st, brief > 1);
|
||||||
if (ap->spares) printf(" spares=%d", ap->spares);
|
if (ap->spares)
|
||||||
|
newline += printf(" spares=%d", ap->spares);
|
||||||
if (brief > 1) {
|
if (brief > 1) {
|
||||||
printf(" devices");
|
newline += printf(" devices");
|
||||||
for (d=dl_next(ap->devs); d!= ap->devs; d=dl_next(d)) {
|
for (d=dl_next(ap->devs); d!= ap->devs; d=dl_next(d)) {
|
||||||
printf("%c%s", sep, d);
|
printf("%c%s", sep, d);
|
||||||
sep=',';
|
sep=',';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ap->st->ss->brief_examine_subarrays)
|
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, brief > 1);
|
||||||
|
}
|
||||||
ap->st->ss->free_super(ap->st);
|
ap->st->ss->free_super(ap->st);
|
||||||
/* FIXME free ap */
|
/* FIXME free ap */
|
||||||
if (ap->spares || brief > 1)
|
if (ap->spares || brief > 1)
|
||||||
|
|
Loading…
Reference in New Issue