Changes by: flatcap
Update of /cvsroot/linux-ntfs/dynamic-disk/test
In directory usw-pr-cvs1:/tmp/cvs-serv1349/test
Modified Files:
drive.c
Log Message:
fixed up the offset, created dummy partition for VMDB
Index: drive.c
===================================================================
RCS file: /cvsroot/linux-ntfs/dynamic-disk/test/drive.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -U2 -r1.1.1.1 -r1.2
--- drive.c 2001/06/16 20:29:39 1.1.1.1
+++ drive.c 2001/06/17 13:46:17 1.2
@@ -113,14 +113,18 @@
unsigned long long size;
int i;
+ int a;
int drive = (3<<8) + 64;
int maxminor = 64;
- memset (hardsect_size, 0, sizeof (hardsect_size));
- memset (blk_size, 0, sizeof (blk_size));
- memset (blksize_size, 0, sizeof (blksize_size));
+ if (argc < 2)
+ {
+ printf ("Usage:\n");
+ printf (" %s device ...\n", argv[0]);
+ return 1;
+ }
- if (argc == 2)
+ for (a = 1; a < argc; a++)
{
- device = open (argv[1], O_RDONLY);
+ device = open (argv[a], O_RDONLY);
if (device < 0)
{
@@ -132,13 +136,22 @@
if (size > 0)
{
+ memset (hardsect_size, 0, sizeof (hardsect_size));
+ memset (blk_size, 0, sizeof (blk_size));
+ memset (blksize_size, 0, sizeof (blksize_size));
+ memset (hd, 0, sizeof (hd));
+ memset (hd_sizes, 0, sizeof (hd_sizes));
+
register_disk (&hd_gendisk, drive, maxminor, NULL, size);
}
close (device);
- printf ("\nDevice Offset Size\n");
+ printf ("\nDevice | Offset Bytes Sectors Mb | Size Bytes Sectors Mb\n"
+ "-------+--------------------------------+-------------------------------\n");
for (i = 0; i < 256; i++)
{
char buf[10];
int minor = i % maxminor;
+ long long start;
+ long long size;
if (hd[i].nr_sects == 0)
@@ -150,13 +163,10 @@
sprintf (buf, "%s%c", hd_gendisk.major_name, (i>>hd_gendisk.minor_shift) + 'a');
- printf ("%-6s %10ld %10ld (%ld Mb)\n", buf, hd[i].start_sect, hd[i].nr_sects, hd[i].nr_sects>>11);
+ start = hd[i].start_sect; start <<= 9;
+ size = hd[i].nr_sects; size <<= 9;
+ printf ("%-6s | %12lld %10lld %6lld | %12lld %10lld %6lld\n", buf, start, start>>9, start>>20, size, size>>9, size>>20);
}
printf ("\n");
}
- }
- else
- {
- printf ("Usage:\n");
- printf (" %s device\n", argv[0]);
}
|