FreeBSD/sys/kern/vfs_vnops.c
/*
 * Preparing to start a filesystem write operation. If the operation is
 * permitted, then we bump the count of operations in progress and
 * proceed. If a suspend request is in progress, we wait until the
 * suspension is over, and then proceed.
 */
Preparing to start a filesystem write operation. If the operation is
permitted, then we bump the count of operations in progress and
proceed. If a suspend request is in progress, we wait until the
suspension is over, and then proceed.
Preparing to start a filesystem write operation . If the operation is permitted then we bump the count of operations in progress and proceed . If a suspend request is in progress we wait until the suspension is over and then proceed .
static int
vn_start_write_locked(struct mount *mp, int flags)
{
	int error, mflags;
	mtx_assert(MNT_MTX(mp), MA_OWNED);
	error = 0;
	if ((curthread->td_pflags & TDP_IGNSUSP) == 0 ||
	    mp->mnt_susp_owner != curthread) {
		mflags = ((mp->mnt_vfc->vfc_flags & VFCF_SBDRY) != 0 ?
		    (flags & PCATCH) : 0) | (PUSER - 1);
		while ((mp->mnt_kern_flag & MNTK_SUSPEND) != 0) {
			if (flags & V_NOWAIT) {
				error = EWOULDBLOCK;
				goto unlock;
			}
			error = msleep(&mp->mnt_flag, MNT_MTX(mp), mflags,
			    "suspfs", 0);
			if (error)
				goto unlock;
		}
	}
	if (flags & V_XSLEEP)
		goto unlock;
	mp->mnt_writeopcount++;
unlock:
	if (error != 0 || (flags & V_XSLEEP) != 0)
		MNT_REL(mp);
	MNT_IUNLOCK(mp);
	return (error);
}
static int vn_start_write_locked ( struct mount * mp , int flags ) { int error , mflags ; mtx_assert ( MNT_MTX ( mp ) , MA_OWNED ) ; error = 0 ; if ( ( curthread -> td_pflags & TDP_IGNSUSP ) == 0 || mp -> mnt_susp_owner != curthread ) { mflags = ( ( mp -> mnt_vfc -> vfc_flags & VFCF_SBDRY ) != 0 ? ( flags & PCATCH ) : 0 ) | ( PUSER - 1 ) ; while ( ( mp -> mnt_kern_flag & MNTK_SUSPEND ) != 0 ) { if ( flags & V_NOWAIT ) { error = EWOULDBLOCK ; goto unlock ; } error = msleep ( & mp -> mnt_flag , MNT_MTX ( mp ) , mflags , " " , 0 ) ; if ( error ) goto unlock ; } } if ( flags & V_XSLEEP ) goto unlock ; mp -> mnt_writeopcount ++ ; unlock : if ( error != 0 || ( flags & V_XSLEEP ) != 0 ) MNT_REL ( mp ) ; MNT_IUNLOCK ( mp ) ; return ( error ) ; }
Preparing to start a filesystem write operation.
Preparing to start a filesystem write operation .
/*
	 * Check on status of suspension.
	 */