Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/vfs_subr.c
Show First 20 Lines • Show All 825 Lines • ▼ Show 20 Lines | vfs_busy(struct mount *mp, int flags) | ||||
* should retry. Otherwise the unmounter thread will set MNTK_REFEXPIRE | * should retry. Otherwise the unmounter thread will set MNTK_REFEXPIRE | ||||
* flag in addition to MNTK_UNMOUNT, indicating that mount point is | * flag in addition to MNTK_UNMOUNT, indicating that mount point is | ||||
* about to be really destroyed. vfs_busy needs to release its | * about to be really destroyed. vfs_busy needs to release its | ||||
* reference on the mount point in this case and return with ENOENT, | * reference on the mount point in this case and return with ENOENT, | ||||
* telling the caller that mount mount it tried to busy is no longer | * telling the caller that mount mount it tried to busy is no longer | ||||
* valid. | * valid. | ||||
*/ | */ | ||||
while (mp->mnt_kern_flag & MNTK_UNMOUNT) { | while (mp->mnt_kern_flag & MNTK_UNMOUNT) { | ||||
KASSERT(mp->mnt_pinned_count == 0, | |||||
("%s: non-zero pinned count %d with pending unmount", | |||||
__func__, mp->mnt_pinned_count)); | |||||
if (flags & MBF_NOWAIT || mp->mnt_kern_flag & MNTK_REFEXPIRE) { | if (flags & MBF_NOWAIT || mp->mnt_kern_flag & MNTK_REFEXPIRE) { | ||||
MNT_REL(mp); | MNT_REL(mp); | ||||
MNT_IUNLOCK(mp); | MNT_IUNLOCK(mp); | ||||
CTR1(KTR_VFS, "%s: failed busying before sleeping", | CTR1(KTR_VFS, "%s: failed busying before sleeping", | ||||
__func__); | __func__); | ||||
return (ENOENT); | return (ENOENT); | ||||
} | } | ||||
if (flags & MBF_MNTLSTLOCK) | if (flags & MBF_MNTLSTLOCK) | ||||
▲ Show 20 Lines • Show All 6,163 Lines • Show Last 20 Lines |