Changes by: flatcap
Update of /cvsroot/linux-ntfs/dynamic-disk/test
In directory usw-pr-cvs1:/tmp/cvs-serv6178/test
Modified Files:
dump.c ldminfo.c ldminfo.h
Log Message:
lots of minor formatting changes
guid code swapped again. if it doesn't work, I want to see examples
all the offsets are ranged checked against known safe values
added a check to see if the database was in an inconsistant state
shortened a few names for convenience
Index: dump.c
===================================================================
RCS file: /cvsroot/linux-ntfs/dynamic-disk/test/dump.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -U2 -r1.11 -r1.12
--- dump.c 27 Feb 2002 17:35:40 -0000 1.11
+++ dump.c 10 Apr 2002 15:42:00 -0000 1.12
@@ -290,10 +290,10 @@
* dump_database -
*/
-void dump_database (char *name, struct tocblock *toc, struct ldmdb *ldb)
+void dump_database (char *name, struct ldmdb *ldb)
{
printf ("Device: %s\n\n", name);
dump_privhead (&ldb->ph);
- dump_tocblock (toc);
+ dump_tocblock (&ldb->toc);
dump_vmdb (ldb);
dump_disks (ldb);
Index: ldminfo.c
===================================================================
RCS file: /cvsroot/linux-ntfs/dynamic-disk/test/ldminfo.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -U2 -r1.23 -r1.24
--- ldminfo.c 27 Feb 2002 17:35:40 -0000 1.23
+++ ldminfo.c 10 Apr 2002 15:42:01 -0000 1.24
@@ -83,5 +83,5 @@
*/
int ldm_partition2 (struct gendisk *hd, struct block_device *bdev, struct ldmdb *ldb,
- struct tocblock *toc, int first_minor)
+ int first_minor)
{
struct vblk *disk;
@@ -92,5 +92,5 @@
return -1;
- if (!ldm_validate_privheads (bdev, 0, &ldb->ph))
+ if (!ldm_validate_privheads (bdev, 0, &ldb->ph, hd, first_minor))
return -1;
@@ -99,6 +99,6 @@
/* Parse and check tocs and vmdb. */
- if (!ldm_validate_tocblocks (bdev, base, toc) ||
- !ldm_validate_vmdb (bdev, base, &ldb->vm))
+ if (!ldm_validate_tocblocks (bdev, base, ldb) ||
+ !ldm_validate_vmdb (bdev, base, ldb))
return -1;
@@ -164,5 +164,4 @@
for (a = 1; a < argc; a++) {
long long size;
- struct tocblock *toc;
struct ldmdb ldb; //FIXME move to heap
@@ -194,10 +193,4 @@
INIT_LIST_HEAD(&ldb.v_part);
- toc = kmalloc (sizeof (*toc), GFP_KERNEL);
- if (!toc) {
- printk (LDM_CRIT "Not enough memory for required buffers.\n");
- goto free_structs;
- }
-
memset (hardsect_size, 0, sizeof (hardsect_size));
memset (blk_size, 0, sizeof (blk_size));
@@ -211,8 +204,8 @@
bdev.bd_dev = kdev_val(drive); /* hack (bd_dev isn't a kdev_t) */
- ldm_partition2 (&hd_gendisk, &bdev, &ldb, toc, minor + 1);
+ ldm_partition2 (&hd_gendisk, &bdev, &ldb, minor + 1);
if (dump)
- dump_database (argv[a], toc, &ldb);
+ dump_database (argv[a], &ldb);
else
dump_info (argv[a], maxminor);
@@ -223,6 +216,4 @@
ldm_free_vblks(&ldb.v_comp);
ldm_free_vblks(&ldb.v_part);
-free_structs:
- kfree (toc);
close:
close (device);
Index: ldminfo.h
===================================================================
RCS file: /cvsroot/linux-ntfs/dynamic-disk/test/ldminfo.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -U2 -r1.13 -r1.14
--- ldminfo.h 27 Feb 2002 17:35:40 -0000 1.13
+++ ldminfo.h 10 Apr 2002 15:42:01 -0000 1.14
@@ -75,5 +75,5 @@
};
-void dump_database (char *name, struct tocblock *toc, struct ldmdb *ldb);
+void dump_database (char *name, struct ldmdb *ldb);
void copy_database (char *file, int fd, long long size);
struct buffer_head * ldm_bread (kdev_t dev, int block, int size);
@@ -81,7 +81,7 @@
BOOL ldm_create_partition (struct gendisk *hd, int minor, int start, int size);
BOOL ldm_create_data_partitions (struct gendisk *hd, unsigned long first_sector, int first_minor, const struct ldmdb *ldb, const struct vblk *disk);
-int ldm_validate_privheads (struct block_device *bdev, unsigned long base, const struct privhead *ph1);
-int ldm_validate_tocblocks (struct block_device *bdev, unsigned long base, struct tocblock *toc1);
-int ldm_validate_vmdb (struct block_device *bdev, unsigned long base, struct vmdb *vm);
+int ldm_validate_privheads (struct block_device *bdev, unsigned long base, const struct privhead *ph1, struct gendisk *hd, unsigned long first_minor);
+int ldm_validate_tocblocks (struct block_device *bdev, unsigned long base, struct ldmdb *ldb);
+int ldm_validate_vmdb (struct block_device *bdev, unsigned long base, struct ldmdb *ldb);
int ldm_get_buffers (struct block_device *bdev, unsigned long base, struct vmdb *vm, list_t *lh_bh, list_t *lh_vl);
struct vblk * ldm_get_disk_objid (const struct ldmdb *ldb);
|