summaryrefslogtreecommitdiff
path: root/ext2fs/ext2fs.c
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-02-03 10:31:14 +0000
committerMiles Bader <miles@gnu.org>1996-02-03 10:31:14 +0000
commitb6078883848500fba79ac0998de3e5243b383b66 (patch)
tree1cef1fe8d32af129469d88f135067eaa172ab925 /ext2fs/ext2fs.c
parent1ce0d3c1acb2d1adaf8fe0d2dca3c13b3d929584 (diff)
Tue Jan 30 22:25:19 1996 Miles Bader <miles@gnu.ai.mit.edu>
* hyper.c (get_hypermetadata): Don't return any error value, just panic if we can't read the superblock. * ext2fs.c (main): Move warp_inode() inline. Make sure root inode is really there. Don't check return value from get_hypermetadata. (warp_inode): Function removed. * ext2fs.h (get_hypermetadata): Returns void now.
Diffstat (limited to 'ext2fs/ext2fs.c')
-rw-r--r--ext2fs/ext2fs.c27
1 files changed, 8 insertions, 19 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