Spares that are specified on container can be used by any array in container.
this means that for every array in container they should be reported.
This let caller know how many spare devices (not used in any array)
are still available.
Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
struct mdinfo *rest = NULL;
unsigned int i;
int bbm_errors = 0;
+ struct dl *d;
+ int spare_disks = 0;
/* check for bad blocks */
if (imsm_bbm_log_size(super->anchor))
bbm_errors = 1;
+ /* count spare devices, not used in maps
+ */
+ for (d = super->disks; d; d = d->next)
+ if (d->index == -1)
+ spare_disks++;
+
for (i = 0; i < mpb->num_raid_devs; i++) {
struct imsm_dev *dev;
struct imsm_map *map;
}
/* now that the disk list is up-to-date fixup recovery_start */
update_recovery_start(dev, this);
+ this->array.spare_disks += spare_disks;
rest = this;
}