summaryrefslogtreecommitdiff
path: root/ufs/main.c
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1994-09-23 02:52:58 +0000
committerMichael I. Bushnell <mib@gnu.org>1994-09-23 02:52:58 +0000
commit4efa7764e9c765c1767a83801f904a9dc4384ea9 (patch)
tree540e586e308c619581cf63200a3658ba9a3023a2 /ufs/main.c
parent185e02285aa9c882750d7d6cb6b871c26ba9aa57 (diff)
Formerly main.c.~19~
Diffstat (limited to 'ufs/main.c')
-rw-r--r--ufs/main.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/ufs/main.c b/ufs/main.c
index ee0e2268..5fd1ff11 100644
--- a/ufs/main.c
+++ b/ufs/main.c
@@ -98,7 +98,6 @@ main (int argc, char **argv)
error_t err;
int sizes[DEV_GET_SIZE_COUNT];
u_int sizescnt = 2;
-
save_argv = argv;
@@ -145,6 +144,29 @@ main (int argc, char **argv)
exit (1);
}
+ diskpagersize = sizes[DEV_GET_SIZE_DEVICE_SIZE];
+ assert (diskpagersize >= SBSIZE + SBOFF);
+
+ /* Map the entire disk. */
+ create_disk_pager ();
+
+ err = vm_map (mach_task_self (), (vm_address_t *)&disk_image,
+ diskpagersize, 0, 1, diskpagerport, 0, 0,
+ VM_PROT_READ | (diskfs_readonly ? 0 : VM_PROT_WRITE),
+ VM_PROT_READ | (diskfs_readonly ? 0 : VM_PROT_WRITE),
+ VM_INHERIT_NONE);
+ assert (!err);
+
+ if (diskpagersize < sblock->fs_size * sblock->fs_fsize)
+ {
+ fprintf (stderr,
+ "Disk size %d less than necessary "
+ "(superblock says we need %ld)\n",
+ sizes[DEV_GET_SIZE_DEVICE_SIZE],
+ sblock->fs_size * sblock->fs_fsize);
+ exit (1);
+ }
+
get_hypermetadata ();
/* Check to make sure device size is big enough. */