diff options
-rw-r--r-- | ext2fs/ext2fs.c | 27 | ||||
-rw-r--r-- | ext2fs/ext2fs.h | 2 | ||||
-rw-r--r-- | ext2fs/hyper.c | 9 |
3 files changed, 12 insertions, 26 deletions
diff --git a/ext2fs/ext2fs.c b/ext2fs/ext2fs.c index 5a6c5d39..d422cc2c 100644 --- a/ext2fs/ext2fs.c +++ b/ext2fs/ext2fs.c @@ -44,22 +44,8 @@ int diskfs_edit_version = 0; int diskfs_synchronous = 0; int diskfs_readonly = 0; - -/* ---------------------------------------------------------------- */ struct node *diskfs_root_node; - -/* Set diskfs_root_node to the root inode. */ -static void -warp_root (void) -{ - error_t err; - err = iget (EXT2_ROOT_INO, &diskfs_root_node); - assert (!err); - mutex_unlock (&diskfs_root_node->lock); -} - -/* ---------------------------------------------------------------- */ void main (int argc, char **argv) @@ -104,14 +90,17 @@ main (int argc, char **argv) pokel_init (&global_pokel, disk_pager, disk_image); - err = get_hypermetadata(); - if (err) - error (3, err, "get_hypermetadata"); + get_hypermetadata(); inode_init (); - /* Find our root node. */ - warp_root (); + /* Set diskfs_root_node to the root inode. */ + err = iget (EXT2_ROOT_INO, &diskfs_root_node); + if (err) + ext2_panic ("can't get root: %s", strerror (err)); + else if ((diskfs_root_node->dn_stat.st_mode & S_IFMT) == 0) + ext2_panic ("no root node!"); + mutex_unlock (&diskfs_root_node->lock); /* Now that we are all set up to handle requests, and diskfs_root_node is set properly, it is safe to export our fsys control port to the diff --git a/ext2fs/ext2fs.h b/ext2fs/ext2fs.h index b0aab284..b27e8b06 100644 --- a/ext2fs/ext2fs.h +++ b/ext2fs/ext2fs.h @@ -226,7 +226,7 @@ unsigned log2_stat_blocks_per_fs_block; vm_address_t zeroblock; /* Get the superblock from the disk, & setup various global info from it. */ -error_t get_hypermetadata (); +void get_hypermetadata (); /* ---------------------------------------------------------------- */ diff --git a/ext2fs/hyper.c b/ext2fs/hyper.c index fa70888f..c31c3972 100644 --- a/ext2fs/hyper.c +++ b/ext2fs/hyper.c @@ -1,6 +1,6 @@ /* Fetching and storing the hypermetadata (superblock and bg summary info) - Copyright (C) 1994, 1995 Free Software Foundation, Inc. + Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc. Written by Miles Bader <miles@gnu.ai.mit.edu> @@ -52,13 +52,12 @@ static void allocate_mod_map () modified_global_blocks = 0; } -error_t +void get_hypermetadata (void) { error_t err = diskfs_catch_exception (); - if (err) - return err; + ext2_panic ("can't read superblock: %s", strerror (err)); if (zeroblock) vm_deallocate (mach_task_self (), zeroblock, block_size); @@ -129,8 +128,6 @@ get_hypermetadata (void) /* A handy source of page-aligned zeros. */ vm_allocate (mach_task_self (), &zeroblock, block_size, 1); - - return 0; } void |