/*
* mdadm - manage Linux "md" devices aka RAID arrays.
*
- * Copyright (C) 2001-2006 Neil Brown <neilb@suse.de>
+ * Copyright (C) 2001-2009 Neil Brown <neilb@suse.de>
*
*
* This program is free software; you can redistribute it and/or modify
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Neil Brown
- * Email: <neilb@cse.unsw.edu.au>
- * Paper: Neil Brown
- * School of Computer Science and Engineering
- * The University of New South Wales
- * Sydney, 2052
- * Australia
+ * Email: <neilb@suse.de>
*/
#include "mdadm.h"
#endif
#include "md_u.h"
#include "md_p.h"
-int Examine(mddev_dev_t devlist, int brief, int scan,
+int Examine(mddev_dev_t devlist, int brief, int export, int scan,
int SparcAdjust, struct supertype *forcest,
char *homehost)
{
st->ss->update_super(st, NULL, "sparc2.2",
devlist->devname, 0, 0, NULL);
/* Ok, its good enough to try, though the checksum could be wrong */
+
if (brief) {
struct array *ap;
char *d;
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 & MD_DISK_SYNC))
+ if (!(ap->info.disk.state & (1<<MD_DISK_SYNC)))
ap->spares++;
d = dl_strdup(devlist->devname);
dl_add(ap->devs, d);
+ } else if (export) {
+ if (st->ss->export_examine_super)
+ st->ss->export_examine_super(st);
} else {
printf("%s:\n",devlist->devname);
st->ss->examine_super(st, homehost);
for (ap=arrays; ap; ap=ap->next) {
char sep='=';
char *d;
- ap->st->ss->brief_examine_super(ap->st);
+ ap->st->ss->brief_examine_super(ap->st, brief > 1);
if (ap->spares) printf(" spares=%d", ap->spares);
if (brief > 1) {
printf(" devices");