FreeBSD/sys/kern/vfs_bio.c
/*
 *	buf_scan:
 *
 *	Scan the clean queues looking for a buffer to recycle.  needsbuffer
 *	is set on failure so that the caller may optionally bufspace_wait()
 *	in a race-free fashion.
 */
Scan the clean queues looking for a buffer to recycle.  needsbuffer
is set on failure so that the caller may optionally bufspace_wait()
in a race-free fashion.
Scan the clean queues looking for a buffer to recycle . needsbuffer is set on failure so that the caller may optionally bufspace_wait () in a race - free fashion .
static int
buf_scan(bool defrag)
{
	int error;
	if ((error = buf_recycle(defrag)) != 0) {
		atomic_set_int(&needsbuffer, 1);
		bufspace_daemonwakeup();
		error = buf_recycle(defrag);
	}
	if (error == 0)
		atomic_add_int(&getnewbufrestarts, 1);
	return (error);
}
static int buf_scan ( bool defrag ) { int error ; if ( ( error = buf_recycle ( defrag ) ) != 0 ) { atomic_set_int ( & needsbuffer , 1 ) ; bufspace_daemonwakeup ( ) ; error = buf_recycle ( defrag ) ; } if ( error == 0 ) atomic_add_int ( & getnewbufrestarts , 1 ) ; return ( error ) ; }
buf_scan:
      Scan the clean queues looking for a buffer to recycle.
buf_scan : Scan the clean queues looking for a buffer to recycle .
/*
	 * To avoid heavy synchronization and wakeup races we set
	 * needsbuffer and re-poll before failing.  This ensures that
	 * no frees can be missed between an unsuccessful poll and
	 * going to sleep in a synchronized fashion.
	 */