- else if (in_devs && strncmp(w, "md", 2)==0) {
- /* This has an md device as a component.
- * If that device is already in the list,
- * make sure we insert before there.
- */
- struct mdstat_ent **ih;
- int dn2;
- if (strncmp(w, "md_d", 4)==0)
- dn2 = -1-strtoul(w+4, &ep, 10);
- else
- dn2 = strtoul(w+2, &ep, 10);
- ih = &all;
- while (ih != insert_here && *ih &&
- (*ih)->devnum != dn2)
- ih = & (*ih)->next;
- insert_here = ih;
+ else if (in_devs) {
+ ent->devcnt++;
+ if (strncmp(w, "md", 2)==0) {
+ /* This has an md device as a component.
+ * If that device is already in the
+ * list, make sure we insert before
+ * there.
+ */
+ struct mdstat_ent **ih;
+ int dn2 = devname2devnum(w);
+ ih = &all;
+ while (ih != insert_here && *ih &&
+ (*ih)->devnum != dn2)
+ ih = & (*ih)->next;
+ insert_here = ih;
+ }
+ } else if (strcmp(w, "super") == 0 &&
+ dl_next(w) != line) {
+ w = dl_next(w);
+ ent->metadata_version = strdup(w);
+ } else if (w[0] == '[' && isdigit(w[1])) {
+ ent->raid_disks = atoi(w+1);