FreeBSD/sys/kern/vfs_bio.c
/*
 *	waitrunningbufspace()
 *
 *	runningbufspace is a measure of the amount of I/O currently
 *	running.  This routine is used in async-write situations to
 *	prevent creating huge backups of pending writes to a device.
 *	Only asynchronous writes are governed by this function.
 *
 *	This does NOT turn an async write into a sync write.  It waits  
 *	for earlier writes to complete and generally returns before the
 *	caller's write has reached the device.
 */
waitrunningbufspace()
runningbufspace is a measure of the amount of I/O currently
running.  This routine is used in async-write situations to
prevent creating huge backups of pending writes to a device.
Only asynchronous writes are governed by this function.

This does NOT turn an async write into a sync write.  It waits
for earlier writes to complete and generally returns before the
caller's write has reached the device.
waitrunningbufspace () runningbufspace is a measure of the amount of I / O currently running . This routine is used in async - write situations to prevent creating huge backups of pending writes to a device . Only asynchronous writes are governed by this function . This does NOT turn an async write into a sync write . It waits for earlier writes to complete and generally returns before the caller ' s write has reached the device .
void
waitrunningbufspace(void)
{
	mtx_lock(&rbreqlock);
	while (runningbufspace > hirunningspace) {
		runningbufreq = 1;
		msleep(&runningbufreq, &rbreqlock, PVM, "wdrain", 0);
	}
	mtx_unlock(&rbreqlock);
}
void waitrunningbufspace ( void ) { mtx_lock ( & rbreqlock ) ; while ( runningbufspace > hirunningspace ) { runningbufreq = 1 ; msleep ( & runningbufreq , & rbreqlock , PVM , " " , 0 ) ; } mtx_unlock ( & rbreqlock ) ; }
waitrunningbufspace()
      runningbufspace is a measure of the amount of I/O currently
      running.
waitrunningbufspace () runningbufspace is a measure of the amount of I / O currently running .