X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fmdadm.git;a=blobdiff_plain;f=Examine.c;h=01838c8b48d3307c3350cbd6efe2a1fe73519f67;hp=46fee95047340942390574be2cf0373f8592b5ff;hb=0f22b998fb9cf8478810b89cd50fa5b4fbf11d38;hpb=0ea2b5ef1be03802f34537330884cdaf72494b01 diff --git a/Examine.c b/Examine.c index 46fee950..01838c8b 100644 --- a/Examine.c +++ b/Examine.c @@ -100,7 +100,11 @@ int Examine(mddev_dev_t devlist, int brief, int export, int scan, devlist->devname, 0, 0, NULL); /* Ok, its good enough to try, though the checksum could be wrong */ - if (brief) { + if (brief && st->ss->brief_examine_super == NULL) { + if (!scan) + fprintf(stderr, Name ": No brief listing for %s on %s\n", + st->ss->name, devlist->devname); + } else if (brief) { struct array *ap; char *d; for (ap=arrays; ap; ap=ap->next) { @@ -116,11 +120,10 @@ int Examine(mddev_dev_t devlist, int brief, int export, int scan, ap->st = st; arrays = ap; st->ss->getinfo_super(st, &ap->info); - } else { + } else st->ss->getinfo_super(st, &ap->info); - st->ss->free_super(st); - } - if (!(ap->info.disk.state & (1<loaded_container && + !(ap->info.disk.state & (1<spares++; d = dl_strdup(devlist->devname); dl_add(ap->devs, d); @@ -138,15 +141,23 @@ int Examine(mddev_dev_t devlist, int brief, int export, int scan, for (ap=arrays; ap; ap=ap->next) { char sep='='; char *d; + int newline = 0; + 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) { - printf(" devices"); + newline += printf(" devices"); for (d=dl_next(ap->devs); d!= ap->devs; d=dl_next(d)) { printf("%c%s", sep, d); sep=','; } } + if (ap->st->ss->brief_examine_subarrays) { + if (newline) + printf("\n"); + ap->st->ss->brief_examine_subarrays(ap->st, brief > 1); + } ap->st->ss->free_super(ap->st); /* FIXME free ap */ if (ap->spares || brief > 1)