+ /*** FIX: Need to do something about RAID-6 here ***/
+ if ( (level == 5 || level == 6) &&
+ (insert_point < raiddisks || first_missing < raiddisks) )
+ array.state = 1; /* clean, but one+ drive will be missing */
+ else
+ array.state = 0; /* not clean, but no errors */
+
+ /* There is lots of redundancy in these disk counts,
+ * raid_disks is the most meaningful value
+ * it describes the geometry of the array
+ * it is constant
+ * nr_disks is total number of used slots.
+ * it should be raid_disks+spare_disks
+ * spare_disks is the number of extra disks present
+ * see above
+ * active_disks is the number of working disks in
+ * active slots. (With raid_disks)
+ * working_disks is the total number of working disks,
+ * including spares
+ * failed_disks is the number of disks marked failed
+ *
+ * Ideally, the kernel would keep these (except raid_disks)
+ * up-to-date as we ADD_NEW_DISK, but it doesn't (yet).
+ * So for now, we assume that all raid and spare
+ * devices will be given.
+ */
+ array.spare_disks=sparedisks;
+ array.failed_disks=missing_disks;
+ array.nr_disks = array.working_disks + array.failed_disks;