From d9cf46ccd62c581063bc58980ca9373af8ab8b46 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Thu, 19 Oct 1995 20:47:24 +0000 Subject: (main): Always include VM_PROT_WRITE in max prot. Move stuff into get_hypermetadata. Writable init code moved to diskfs_readonly_changed. (diskfs_reload_global_state): New function. --- ufs/main.c | 38 ++++++++++---------------------------- 1 file changed, 10 insertions(+), 28 deletions(-) (limited to 'ufs/main.c') diff --git a/ufs/main.c b/ufs/main.c index f360220b..5a447f94 100644 --- a/ufs/main.c +++ b/ufs/main.c @@ -108,39 +108,12 @@ main (int argc, char **argv) err = vm_map (mach_task_self (), (vm_address_t *)&disk_image, disk_size, 0, 1, diskpagerport, 0, 0, VM_PROT_READ | (diskfs_readonly ? 0 : VM_PROT_WRITE), - VM_PROT_READ | (diskfs_readonly ? 0 : VM_PROT_WRITE), + VM_PROT_READ | VM_PROT_WRITE, VM_INHERIT_NONE); assert (!err); get_hypermetadata (); - if (disk_size < sblock->fs_size * sblock->fs_fsize) - { - fprintf (stderr, - "Disk size (%ld) less than necessary " - "(superblock says we need %ld)\n", - disk_size, sblock->fs_size * sblock->fs_fsize); - exit (1); - } - - vm_allocate (mach_task_self (), &zeroblock, sblock->fs_bsize, 1); - - /* If the filesystem has new features in it, don't pay attention to - the user's request not to use them. */ - if ((sblock->fs_inodefmt == FS_44INODEFMT - || direct_symlink_extension) - && compat_mode == COMPAT_BSD42) - /* XXX should syslog to this effect */ - compat_mode = COMPAT_BSD44; - - if (!diskfs_readonly) - { - sblock->fs_clean = 0; - strcpy (sblock->fs_fsmnt, "Hurd /"); /* XXX */ - sblock_dirty = 1; - diskfs_set_hypermetadata (1, 0); - } - inode_init (); /* Find our root node. */ @@ -156,3 +129,12 @@ main (int argc, char **argv) return 0; } + +error_t +diskfs_reload_global_state () +{ + flush_pokes (); + pager_flush (diskpager->p, 1); + get_hypermetadata (); + return 0; +} -- cgit v1.2.3