Changes by: flatcap
Update of /cvsroot/linux-ntfs/dynamic-disk/ldminfo
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22140
Modified Files:
ldm.c
Log Message:
fix bugs:
make dump work again
print the sequence numbers
Index: ldm.c
===================================================================
RCS file: /cvsroot/linux-ntfs/dynamic-disk/ldminfo/ldm.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- ldm.c 11 Sep 2005 23:53:24 -0000 1.1
+++ ldm.c 16 Sep 2005 00:04:11 -0000 1.2
@@ -930,6 +930,12 @@ static BOOL ldm_parse_dgr4 (const u8 *bu
dgrp = &vb->vblk.dgrp;
ldm_get_vstr (buffer + 0x18 + r_objid, buf, sizeof (buf));
+ //if (r_id1) {
+ // ldm_get_vstr (buffer + 0x18 + r_id1, dgrp->disk_id,
+ // sizeof (dgrp->disk_id));
+ //} else {
+ memset (dgrp->disk_id, 0, sizeof (dgrp->disk_id));
+ //}
return TRUE;
}
@@ -1152,9 +1158,10 @@ static BOOL ldm_parse_vblk (const u8 *bu
return FALSE;
}
- vb->flags = buf[0x12];
- vb->type = buf[0x13];
- vb->obj_id = ldm_get_vnum (buf + 0x18);
+ vb->sequence = BE32 (buf + 0x04);
+ vb->flags = buf[0x12];
+ vb->type = buf[0x13];
+ vb->obj_id = ldm_get_vnum (buf + 0x18);
ldm_get_vstr (buf+0x18+r_objid, vb->name, sizeof (vb->name));
switch (vb->type) {
@@ -1198,7 +1205,7 @@ static BOOL ldm_ldmdb_add (u8 *data, int
BUG_ON (!data || !ldb);
- vb = malloc (sizeof (*vb));
+ vb = calloc (1, sizeof (*vb));
if (!vb) {
ldm_crit ("Out of memory.");
return FALSE;
@@ -1494,7 +1501,7 @@ int ldm_partition (int dev, struct parse
if (!ldm_get_vblks (dev, base, ldb)) {
ldm_crit ("Failed to read the VBLKs from the database.");
- goto cleanup;
+ goto out;
}
/* Finally, create the data partition devices. */
@@ -1503,13 +1510,6 @@ int ldm_partition (int dev, struct parse
result = 1;
}
/* else Already logged */
-
-cleanup:
- ldm_free_vblks (&ldb->v_dgrp);
- ldm_free_vblks (&ldb->v_disk);
- ldm_free_vblks (&ldb->v_volu);
- ldm_free_vblks (&ldb->v_comp);
- ldm_free_vblks (&ldb->v_part);
out:
return result;
}
|