+ buf = volume_id_get_buffer(id, off, 0x800);
+ if (buf == NULL)
+ return -1;
+ mdp0 = (struct mdp0_super_block *) buf;
+
+ if (le32_to_cpu(mdp0->md_magic) == MD_SB_MAGIC) {
+ uuid.ints[0] = bswap_32(mdp0->set_uuid0);
+ if (le32_to_cpu(mdp0->minor_version >= 90)) {
+ uuid.ints[1] = bswap_32(mdp0->set_uuid1);
+ uuid.ints[2] = bswap_32(mdp0->set_uuid2);
+ uuid.ints[3] = bswap_32(mdp0->set_uuid3);
+ } else {
+ uuid.ints[1] = 0;
+ uuid.ints[2] = 0;
+ uuid.ints[3] = 0;
+ }
+ volume_id_set_uuid(id, uuid.bytes, 0, UUID_MD);
+ snprintf(id->type_version, sizeof(id->type_version)-1, "%u.%u.%u",
+ le32_to_cpu(mdp0->major_version),
+ le32_to_cpu(mdp0->minor_version),
+ le32_to_cpu(mdp0->patch_version));
+ } else if (be32_to_cpu(mdp0->md_magic) == MD_SB_MAGIC) {
+ uuid.ints[0] = mdp0->set_uuid0;
+ if (be32_to_cpu(mdp0->minor_version >= 90)) {
+ uuid.ints[1] = mdp0->set_uuid1;
+ uuid.ints[2] = mdp0->set_uuid2;
+ uuid.ints[3] = mdp0->set_uuid3;
+ } else {
+ uuid.ints[1] = 0;
+ uuid.ints[2] = 0;
+ uuid.ints[3] = 0;
+ }
+ volume_id_set_uuid(id, uuid.bytes, 0, UUID_MD);
+ snprintf(id->type_version, sizeof(id->type_version)-1, "%u.%u.%u",
+ be32_to_cpu(mdp0->major_version),
+ be32_to_cpu(mdp0->minor_version),
+ be32_to_cpu(mdp0->patch_version));
+ } else
+ return -1;
+
+ volume_id_set_usage(id, VOLUME_ID_RAID);
+ id->type = "linux_raid_member";
+ return 0;
+}
+
+static int volume_id_probe_linux_raid1(struct volume_id *id, uint64_t off, uint64_t size)
+{
+ const uint8_t *buf;
+ struct mdp1_super_block *mdp1;
+
+ info("probing at offset 0x%" PRIx64 ", size 0x%" PRIx64 "\n", off, size);
+
+ buf = volume_id_get_buffer(id, off, 0x800);