Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/vfs_mount.c
| Show First 20 Lines • Show All 3,135 Lines • ▼ Show 20 Lines | TAILQ_FOREACH(mp, &mountlist, mnt_list) { | ||||
| mp->mnt_kern_flag &= ~MNTK_SUSPEND_ALL; | mp->mnt_kern_flag &= ~MNTK_SUSPEND_ALL; | ||||
| MNT_IUNLOCK(mp); | MNT_IUNLOCK(mp); | ||||
| vfs_write_resume(mp, 0); | vfs_write_resume(mp, 0); | ||||
| mtx_lock(&mountlist_mtx); | mtx_lock(&mountlist_mtx); | ||||
| vfs_unbusy(mp); | vfs_unbusy(mp); | ||||
| } | } | ||||
| mtx_unlock(&mountlist_mtx); | mtx_unlock(&mountlist_mtx); | ||||
| } | } | ||||
| /* | |||||
| * Clone the mnt_exjail field to a new mount point. | |||||
| */ | |||||
| void | |||||
| vfs_exjail_clone(struct mount *inmp, struct mount *outmp) | |||||
| { | |||||
| struct ucred *cr; | |||||
| struct prison *pr; | |||||
| MNT_ILOCK(inmp); | |||||
| cr = inmp->mnt_exjail; | |||||
| if (cr != NULL) { | |||||
| crhold(cr); | |||||
| MNT_IUNLOCK(inmp); | |||||
| pr = cr->cr_prison; | |||||
| mtx_lock(&pr->pr_mtx); | |||||
| if (pr->pr_state != PRISON_STATE_ALIVE) { | |||||
| mtx_unlock(&pr->pr_mtx); | |||||
| crfree(cr); | |||||
| return; | |||||
| } | |||||
| prison_proc_hold(pr); | |||||
| mtx_unlock(&pr->pr_mtx); | |||||
| MNT_ILOCK(outmp); | |||||
| if (outmp->mnt_exjail == NULL) { | |||||
| outmp->mnt_exjail = cr; | |||||
| atomic_add_int(&cr->cr_prison->pr_exportcnt, 1); | |||||
| cr = NULL; | |||||
| } | |||||
| MNT_IUNLOCK(outmp); | |||||
| prison_proc_free(pr); | |||||
| if (cr != NULL) | |||||
| crfree(cr); | |||||
| } else | |||||
| MNT_IUNLOCK(inmp); | |||||
| } | |||||