FreeBSD/sys/kern/vfs_bio.c
/*
 *	bremfreel:
 *
 *	Removes a buffer from the free list, must be called with the
 *	correct qlock held.
 */
Removes a buffer from the free list, must be called with the
correct qlock held.
Removes a buffer from the free list must be called with the correct qlock held .
static void
bremfreel(struct buf *bp)
{
	CTR3(KTR_BUF, "bremfreel(%p) vp %p flags %X",
	    bp, bp->b_vp, bp->b_flags);
	KASSERT(bp->b_qindex != QUEUE_NONE,
	    ("bremfreel: buffer %p not on a queue.", bp));
	if (bp->b_qindex != QUEUE_EMPTY) {
		BUF_ASSERT_XLOCKED(bp);
	}
	mtx_assert(bqlock(bp->b_qindex), MA_OWNED);
	TAILQ_REMOVE(&bufqueues[bp->b_qindex], bp, b_freelist);
#ifdef INVARIANTS
	KASSERT(bq_len[bp->b_qindex] >= 1, ("queue %d underflow",
	    bp->b_qindex));
	bq_len[bp->b_qindex]--;
#endif
	bp->b_qindex = QUEUE_NONE;
	bp->b_flags &= ~B_REMFREE;
}
static void bremfreel ( struct buf * bp ) { CTR3 ( KTR_BUF , " " , bp , bp -> b_vp , bp -> b_flags ) ; KASSERT ( bp -> b_qindex != QUEUE_NONE , ( " " , bp ) ) ; if ( bp -> b_qindex != QUEUE_EMPTY ) { BUF_ASSERT_XLOCKED ( bp ) ; } mtx_assert ( bqlock ( bp -> b_qindex ) , MA_OWNED ) ; TAILQ_REMOVE ( & bufqueues [ bp -> b_qindex ] , bp , b_freelist ) ; #ifdef INVARIANTS KASSERT ( bq_len [ bp -> b_qindex ] >= 1 , ( " " , bp -> b_qindex ) ) ; bq_len [ bp -> b_qindex ] -- ; #endif bp -> b_qindex = QUEUE_NONE ; bp -> b_flags &= ~ B_REMFREE ; }
bremfreel:
      Removes a buffer from the free list, must be called with the
      correct qlock held.
bremfreel : Removes a buffer from the free list must be called with the correct qlock held .