FreeBSD/sys/kern/vfs_bio.c
/*
 * buf_import:
 *
 *	Import bufs into the uma cache from the buf list.  The system still
 *	expects a static array of bufs and much of the synchronization
 *	around bufs assumes type stable storage.  As a result, UMA is used
 *	only as a per-cpu cache of bufs still maintained on a global list.
 */
Import bufs into the uma cache from the buf list.  The system still
expects a static array of bufs and much of the synchronization
around bufs assumes type stable storage.  As a result, UMA is used
only as a per-cpu cache of bufs still maintained on a global list.
Import bufs into the uma cache from the buf list . The system still expects a static array of bufs and much of the synchronization around bufs assumes type stable storage . As a result UMA is used only as a per - cpu cache of bufs still maintained on a global list .
static int
buf_import(void *arg, void **store, int cnt, int flags)
{
	struct buf *bp;
	int i;
	mtx_lock(&bqlocks[QUEUE_EMPTY]);
	for (i = 0; i < cnt; i++) {
		bp = TAILQ_FIRST(&bufqueues[QUEUE_EMPTY]);
		if (bp == NULL)
			break;
		bremfreel(bp);
		store[i] = bp;
	}
	mtx_unlock(&bqlocks[QUEUE_EMPTY]);
	return (i);
}
static int buf_import ( void * arg , void * * store , int cnt , int flags ) { struct buf * bp ; int i ; mtx_lock ( & bqlocks [ QUEUE_EMPTY ] ) ; for ( i = 0 ; i < cnt ; i ++ ) { bp = TAILQ_FIRST ( & bufqueues [ QUEUE_EMPTY ] ) ; if ( bp == NULL ) break ; bremfreel ( bp ) ; store [ i ] = bp ; } mtx_unlock ( & bqlocks [ QUEUE_EMPTY ] ) ; return ( i ) ; }
buf_import:
      Import bufs into the uma cache from the buf list.
buf_import : Import bufs into the uma cache from the buf list .