/*
* mdadm - manage Linux "md" devices aka RAID arrays.
*
- * Copyright (C) 2001-2002 Neil Brown <neilb@cse.unsw.edu.au>
+ * Copyright (C) 2001-2006 Neil Brown <neilb@suse.de>
*
*
* This program is free software; you can redistribute it and/or modify
#endif
#include "md_u.h"
#include "md_p.h"
-int Examine(mddev_dev_t devlist, int brief, int scan, int SparcAdjust, struct supertype *forcest)
+int Examine(mddev_dev_t devlist, int brief, int scan,
+ int SparcAdjust, struct supertype *forcest,
+ char *homehost)
{
/* Read the raid superblock from a device and
void *super;
struct supertype *st;
struct mdinfo info;
- struct mddev_ident_s ident;
void *devs;
struct array *next;
int spares;
fd = dev_open(devlist->devname, O_RDONLY);
if (fd < 0) {
- if (!scan)
+ if (!scan) {
fprintf(stderr,Name ": cannot open %s: %s\n",
devlist->devname, strerror(errno));
+ rv = 1;
+ }
err = 1;
}
else {
if (st)
err = st->ss->load_super(st, fd, &super, (brief||scan)?NULL:devlist->devname);
else {
- if (!brief)
+ if (!brief) {
fprintf(stderr, Name ": No md superblock detected on %s.\n", devlist->devname);
+ rv = 1;
+ }
err = 1;
}
close(fd);
}
- if (err) {
- rv = 1;
+ if (err)
continue;
- }
if (SparcAdjust)
- st->ss->update_super(NULL, super, "sparc2.2", devlist->devname, 0);
+ st->ss->update_super(NULL, super, "sparc2.2", devlist->devname, 0, 0, NULL);
/* Ok, its good enough to try, though the checksum could be wrong */
if (brief) {
struct array *ap;
ap->spares = 0;
ap->st = st;
arrays = ap;
- st->ss->getinfo_super(&ap->info, &ap->ident, super);
+ st->ss->getinfo_super(&ap->info, super);
} else {
- st->ss->getinfo_super(&ap->info, &ap->ident, super);
+ st->ss->getinfo_super(&ap->info, super);
free(super);
}
if (!(ap->info.disk.state & MD_DISK_SYNC))
dl_add(ap->devs, d);
} else {
printf("%s:\n",devlist->devname);
- st->ss->examine_super(super);
+ st->ss->examine_super(super, homehost);
free(super);
}
}