diff options
author | phk <phk@FreeBSD.org> | 2002-03-08 10:33:11 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2002-03-08 10:33:11 +0000 |
commit | 0a13c0f2f6eea459daeae0e31aab75ee86f1874e (patch) | |
tree | 857bf4b7207179e792209215c70daf9b5e686691 | |
parent | 6b229a1455c9cd14021328f87387a7c0532f3518 (diff) | |
download | FreeBSD-src-0a13c0f2f6eea459daeae0e31aab75ee86f1874e.zip FreeBSD-src-0a13c0f2f6eea459daeae0e31aab75ee86f1874e.tar.gz |
Move the mount of the root filesystem to happen in the init process before
the exec if /sbin/init.
This allows the scheduler to get started and kthreads a chance to run
before we start filesystem operations.
-rw-r--r-- | sys/kern/init_main.c | 2 | ||||
-rw-r--r-- | sys/kern/vfs_conf.c | 7 | ||||
-rw-r--r-- | sys/kern/vfs_mount.c | 7 | ||||
-rw-r--r-- | sys/sys/mount.h | 1 |
4 files changed, 7 insertions, 10 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 7816666..e847534 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -487,6 +487,8 @@ start_init(void *dummy) td = curthread; p = td->td_proc; + vfs_mountroot(NULL); + /* Get the vnode for '/'. Set p->p_fd->fd_cdir to reference it. */ if (VFS_ROOT(TAILQ_FIRST(&mountlist), &rootvnode)) panic("cannot find root vnode"); diff --git a/sys/kern/vfs_conf.c b/sys/kern/vfs_conf.c index 27c2b54..0f1ab00 100644 --- a/sys/kern/vfs_conf.c +++ b/sys/kern/vfs_conf.c @@ -87,7 +87,6 @@ static char *cdrom_rootdevnames[] = { NULL }; -static void vfs_mountroot(void *junk); static int vfs_mountroot_try(char *mountfrom); static int vfs_mountroot_ask(void); static void gets(char *cp); @@ -96,13 +95,11 @@ static void gets(char *cp); char *rootdevnames[2] = {NULL, NULL}; static int setrootbyname(char *name); -SYSINIT(mountroot, SI_SUB_MOUNT_ROOT, SI_ORDER_SECOND, vfs_mountroot, NULL); - /* * Find and mount the root filesystem */ -static void -vfs_mountroot(void *junk) +void +vfs_mountroot(void *foo __unused) { int i; diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 27c2b54..0f1ab00 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -87,7 +87,6 @@ static char *cdrom_rootdevnames[] = { NULL }; -static void vfs_mountroot(void *junk); static int vfs_mountroot_try(char *mountfrom); static int vfs_mountroot_ask(void); static void gets(char *cp); @@ -96,13 +95,11 @@ static void gets(char *cp); char *rootdevnames[2] = {NULL, NULL}; static int setrootbyname(char *name); -SYSINIT(mountroot, SI_SUB_MOUNT_ROOT, SI_ORDER_SECOND, vfs_mountroot, NULL); - /* * Find and mount the root filesystem */ -static void -vfs_mountroot(void *junk) +void +vfs_mountroot(void *foo __unused) { int i; diff --git a/sys/sys/mount.h b/sys/sys/mount.h index b6099d1..5cd748d 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -431,6 +431,7 @@ dev_t vfs_getrootfsid __P((struct mount *)); struct mount *vfs_getvfs __P((fsid_t *)); /* return vfs given fsid */ int vfs_modevent __P((module_t, int, void *)); int vfs_mountedon __P((struct vnode *)); /* is a vfs mounted on vp */ +void vfs_mountroot __P((void *)); /* mount our root filesystem */ int vfs_rootmountalloc __P((char *, char *, struct mount **)); void vfs_unbusy __P((struct mount *, struct thread *td)); void vfs_unmountall __P((void)); |