Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/vfs_mountroot.c
Show First 20 Lines • Show All 231 Lines • ▼ Show 20 Lines | root_mounted(void) | ||||
/* No mutex is acquired here because int stores are atomic. */ | /* No mutex is acquired here because int stores are atomic. */ | ||||
return (root_mount_complete); | return (root_mount_complete); | ||||
} | } | ||||
static void | static void | ||||
set_rootvnode(void) | set_rootvnode(void) | ||||
{ | { | ||||
struct proc *p; | |||||
if (VFS_ROOT(TAILQ_FIRST(&mountlist), LK_EXCLUSIVE, &rootvnode)) | if (VFS_ROOT(TAILQ_FIRST(&mountlist), LK_EXCLUSIVE, &rootvnode)) | ||||
panic("set_rootvnode: Cannot find root vnode"); | panic("set_rootvnode: Cannot find root vnode"); | ||||
VOP_UNLOCK(rootvnode); | VOP_UNLOCK(rootvnode); | ||||
p = curthread->td_proc; | pwd_ensure_dirs(); | ||||
FILEDESC_XLOCK(p->p_fd); | |||||
if (p->p_fd->fd_cdir != NULL) | |||||
vrele(p->p_fd->fd_cdir); | |||||
p->p_fd->fd_cdir = rootvnode; | |||||
VREF(rootvnode); | |||||
if (p->p_fd->fd_rdir != NULL) | |||||
vrele(p->p_fd->fd_rdir); | |||||
p->p_fd->fd_rdir = rootvnode; | |||||
VREF(rootvnode); | |||||
FILEDESC_XUNLOCK(p->p_fd); | |||||
} | } | ||||
static int | static int | ||||
vfs_mountroot_devfs(struct thread *td, struct mount **mpp) | vfs_mountroot_devfs(struct thread *td, struct mount **mpp) | ||||
{ | { | ||||
struct vfsoptlist *opts; | struct vfsoptlist *opts; | ||||
struct vfsconf *vfsp; | struct vfsconf *vfsp; | ||||
struct mount *mp; | struct mount *mp; | ||||
▲ Show 20 Lines • Show All 899 Lines • Show Last 20 Lines |