*/
struct ddf_super *first = st->sb;
struct ddf_super *second = tst->sb;
+ struct dl *dl2;
+ struct vcl *vl2;
+ unsigned int max_vds, max_pds, pd, vd;
if (!first) {
st->sb = tst->sb;
if (memcmp(first->anchor.guid, second->anchor.guid, DDF_GUID_LEN) != 0)
return 2;
+ if (first->anchor.seq != second->anchor.seq) {
+ dprintf("%s: sequence number mismatch %u/%u\n", __func__,
+ __be32_to_cpu(first->anchor.seq),
+ __be32_to_cpu(second->anchor.seq));
+ return 3;
+ }
+ if (first->max_part != second->max_part ||
+ first->phys->used_pdes != second->phys->used_pdes ||
+ first->virt->populated_vdes != second->virt->populated_vdes) {
+ dprintf("%s: PD/VD number mismatch\n", __func__);
+ return 3;
+ }
+
+ max_pds = __be16_to_cpu(first->phys->used_pdes);
+ for (dl2 = second->dlist; dl2; dl2 = dl2->next) {
+ for (pd = 0; pd < max_pds; pd++)
+ if (first->phys->entries[pd].refnum == dl2->disk.refnum)
+ break;
+ if (pd == max_pds) {
+ dprintf("%s: no match for disk %08x\n", __func__,
+ __be32_to_cpu(dl2->disk.refnum));
+ return 3;
+ }
+ }
+
+ max_vds = __be16_to_cpu(first->active->max_vd_entries);
+ for (vl2 = second->conflist; vl2; vl2 = vl2->next) {
+ if (vl2->conf.magic != DDF_VD_CONF_MAGIC)
+ continue;
+ for (vd = 0; vd < max_vds; vd++)
+ if (!memcmp(first->virt->entries[vd].guid,
+ vl2->conf.guid, DDF_GUID_LEN))
+ break;
+ if (vd == max_vds) {
+ dprintf("%s: no match for VD config\n", __func__);
+ return 3;
+ }
+ }
/* FIXME should I look at anything else? */
+
return 0;
}