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.
This commit is contained in:
parent
107a6eaf0a
commit
fb92273bdc
@ -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");
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user