st->minor_version = 0;
st->max_devs = 512;
}
+ st->loaded_container = 0;
return 0;
}
examine_pds(sb);
}
+static void getinfo_super_ddf(struct supertype *st, struct mdinfo *info);
+
+
static void brief_examine_super_ddf(struct supertype *st)
{
/* We just write a generic DDF ARRAY entry
- * The uuid is all hex, 6 groups of 4 bytes
*/
- struct ddf_super *ddf = st->sb;
- int i;
- printf("ARRAY /dev/ddf metadata=ddf UUID=");
- for (i = 0; i < DDF_GUID_LEN; i++) {
- if ((i&3) == 0 && i != 0)
- printf(":");
- printf("%02X", 255&ddf->anchor.guid[i]);
- }
- printf("\n");
+ struct mdinfo info;
+ char nbuf[64];
+ getinfo_super_ddf(st, &info);
+ fname_from_uuid(st, &info, nbuf, ':');
+ printf("ARRAY /dev/ddf metadata=ddf UUID=%s\n", nbuf + 5);
}
static void detail_super_ddf(struct supertype *st, char *homehost)
* Can that be stored in ddf_super??
*/
// struct ddf_super *ddf = st->sb;
+ struct mdinfo info;
+ char nbuf[64];
+ getinfo_super_ddf(st, &info);
+ fname_from_uuid(st, &info, nbuf,':');
+ printf(" UUID=%s", nbuf + 5);
}
#endif
* uuid to put into bitmap file (Create, Grow)
* uuid for backup header when saving critical section (Grow)
* comparing uuids when re-adding a device into an array
+ * In these cases the uuid required is that of the data-array,
+ * not the device-set.
+ * uuid to recognise same set when adding a missing device back
+ * to an array. This is a uuid for the device-set.
+ *
* For each of these we can make do with a truncated
* or hashed uuid rather than the original, as long as
* everyone agrees.
- * In each case the uuid required is that of the data-array,
- * not the device-set.
* In the case of SVD we assume the BVD is of interest,
* though that might be the case if a bitmap were made for
* a mirrored SVD - worry about that later.
*/
struct ddf_super *ddf = st->sb;
struct vcl *vcl = ddf->currentconf;
+ char *guid;
+ char buf[20];
+ struct sha1_ctx ctx;
- if (!vcl)
- memset(uuid, 0, sizeof (uuid));
- else {
- char buf[20];
- struct sha1_ctx ctx;
- sha1_init_ctx(&ctx);
- sha1_process_bytes(&vcl->conf.guid, DDF_GUID_LEN, &ctx);
- if (vcl->conf.sec_elmnt_count > 1)
- sha1_process_bytes(&vcl->conf.sec_elmnt_seq, 1, &ctx);
- sha1_finish_ctx(&ctx, buf);
- memcpy(uuid, buf, sizeof(uuid));
- }
+ if (vcl)
+ guid = vcl->conf.guid;
+ else
+ guid = ddf->anchor.guid;
+
+ sha1_init_ctx(&ctx);
+ sha1_process_bytes(guid, DDF_GUID_LEN, &ctx);
+ if (vcl && vcl->conf.sec_elmnt_count > 1)
+ sha1_process_bytes(&vcl->conf.sec_elmnt_seq, 1, &ctx);
+ sha1_finish_ctx(&ctx, buf);
+ memcpy(uuid, buf, 4*4);
}
static void getinfo_super_ddf_bvd(struct supertype *st, struct mdinfo *info);
info->reshape_active = 0;
+ info->name[0] = 0;
info->array.major_version = -1;
info->array.minor_version = -2;
strcpy(info->text_version, "ddf");
info->safe_mode_delay = 0;
-// uuid_from_super_ddf(info->uuid, sbv);
+ uuid_from_super_ddf(st, info->uuid);
-// info->name[] ?? ;
}
static int rlq_to_layout(int rlq, int prl, int raiddisks);
st->subarray);
info->safe_mode_delay = 200;
-// info->name[] ?? ;
+ info->name[0] = 0;
}
st->max_devs = 512;
st->container_dev = fd2devnum(fd);
}
+ st->loaded_container = 1;
return 0;
}
#endif /* MDASSEMBLE */
this->array.size = this->component_size / 2;
this->container_member = i;
+ ddf->currentconf = vc;
+ uuid_from_super_ddf(st, this->uuid);
+ ddf->currentconf = NULL;
+
sprintf(this->text_version, "/%s/%d",
devnum2devname(st->container_dev),
this->container_member);