diff options
author | julian <julian@FreeBSD.org> | 1997-12-01 11:34:41 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 1997-12-01 11:34:41 +0000 |
commit | 86b96f64231941c0f4cdf59e7bdf84606c193708 (patch) | |
tree | bd5a66cb8c3823d8b7cefa60a37260b84d547cd4 /sys/kern/vfs_mount.c | |
parent | 6ab1ef8c0af954b5a987727a4b695add12414a64 (diff) | |
download | FreeBSD-src-86b96f64231941c0f4cdf59e7bdf84606c193708.zip FreeBSD-src-86b96f64231941c0f4cdf59e7bdf84606c193708.tar.gz |
Cleanup my last patch here
Reviewed by: sef@kthrup.com and phk@freebsd.org
Diffstat (limited to 'sys/kern/vfs_mount.c')
-rw-r--r-- | sys/kern/vfs_mount.c | 75 |
1 files changed, 32 insertions, 43 deletions
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 57a4a54..b5f9b259 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -71,6 +71,9 @@ MALLOC_DEFINE(M_MOUNT, "mount", "vfs mount struct"); struct mount *rootfs; struct vnode *rootvnode; char *mountrootfsname; +#ifdef BOOTP +extern void bootpc_init __P((void)); +#endif /* * vfs_init() will set maxvfsconf @@ -90,7 +93,7 @@ struct vfsconf *vfsconf; * Common entry point for root mounts * * PARAMETERS: - * fsname name of the filesystem + * NONE * * RETURNS: 0 Success * !0 error number (errno.h) @@ -106,70 +109,56 @@ struct vfsconf *vfsconf; * the FFS file system type. This is a matter of * fixing the other file systems, not this code! */ -static int -vfs_mountrootfs(fsname) - char *fsname; +static void +vfs_mountrootfs(void *unused) { struct mount *mp; int err = 0; struct proc *p = curproc; /* XXX */ +#ifdef BOOTP + bootpc_init(); +#endif /* * New root mount structure */ - err = vfs_rootmountalloc(fsname, ROOTNAME, &mp); - if (err) - return (err); + if ((err = vfs_rootmountalloc(mountrootfsname, ROOTNAME, &mp))) { + printf("error %d: ", err); + panic("cannot mount root\n"); + return ; + } mp->mnt_flag |= MNT_ROOTFS; /* * Attempt the mount */ err = VFS_MOUNT(mp, NULL, NULL, NULL, p); - if (err) - goto error_2; + if (err) { + vfs_unbusy(mp, p); + /* + * free mount struct before failing + * (hardly worthwhile with the PANIC eh?) + */ + free( mp, M_MOUNT); + printf("error %d: ", err); + panic("cannot mount root (2)\n"); + return; + } simple_lock(&mountlist_slock); - /* Add fs to list of mounted file systems*/ + + /* + * Add fs to list of mounted file systems + */ CIRCLEQ_INSERT_HEAD(&mountlist, mp, mnt_list); - simple_unlock(&mountlist_slock); + simple_unlock(&mountlist_slock); vfs_unbusy(mp, p); /* root mount, update system time from FS specific data*/ inittodr(mp->mnt_time); - - goto success; - - -error_2: /* mount error*/ - - vfs_unbusy(mp, p); - - /* free mount struct before failing*/ - free( mp, M_MOUNT); - -success: - return( err); + return; } -/* ARGSUSED*/ -static void xxx_vfs_mountroot __P((void *fsnamep)); -#ifdef BOOTP -extern void bootpc_init __P((void)); -#endif -static void -xxx_vfs_mountroot(fsnamep) - void *fsnamep; -{ - /* XXX Add a separate SYSINIT entry */ -#ifdef BOOTP - bootpc_init(); -#endif - /* Mount the root file system. */ - if (vfs_mountrootfs(*((char **) fsnamep))) - panic("cannot mount root"); -} -SYSINIT(mountroot, SI_SUB_MOUNT_ROOT, SI_ORDER_FIRST, xxx_vfs_mountroot, - &mountrootfsname) +SYSINIT(mountroot, SI_SUB_MOUNT_ROOT, SI_ORDER_FIRST, vfs_mountrootfs, NULL) |