FreeBSD/sys/kern/vfs_bio.c
/*
 * buf_free:
 *
 *	Free a buffer to the buf zone once it no longer has valid contents.
 */
Free a buffer to the buf zone once it no longer has valid contents.
Free a buffer to the buf zone once it no longer has valid contents .
static void
buf_free(struct buf *bp)
{
	if (bp->b_flags & B_REMFREE)
		bremfreef(bp);
	if (bp->b_vflags & BV_BKGRDINPROG)
		panic("losing buffer 1");
	if (bp->b_rcred != NOCRED) {
		crfree(bp->b_rcred);
		bp->b_rcred = NOCRED;
	}
	if (bp->b_wcred != NOCRED) {
		crfree(bp->b_wcred);
		bp->b_wcred = NOCRED;
	}
	if (!LIST_EMPTY(&bp->b_dep))
		buf_deallocate(bp);
	bufkva_free(bp);
	BUF_UNLOCK(bp);
	uma_zfree(buf_zone, bp);
	atomic_add_int(&numfreebuffers, 1);
	bufspace_wakeup();
}
static void buf_free ( struct buf * bp ) { if ( bp -> b_flags & B_REMFREE ) bremfreef ( bp ) ; if ( bp -> b_vflags & BV_BKGRDINPROG ) panic ( " " ) ; if ( bp -> b_rcred != NOCRED ) { crfree ( bp -> b_rcred ) ; bp -> b_rcred = NOCRED ; } if ( bp -> b_wcred != NOCRED ) { crfree ( bp -> b_wcred ) ; bp -> b_wcred = NOCRED ; } if ( ! LIST_EMPTY ( & bp -> b_dep ) ) buf_deallocate ( bp ) ; bufkva_free ( bp ) ; BUF_UNLOCK ( bp ) ; uma_zfree ( buf_zone , bp ) ; atomic_add_int ( & numfreebuffers , 1 ) ; bufspace_wakeup ( ) ; }
buf_free:
      Free a buffer to the buf zone once it no longer has valid contents.
buf_free : Free a buffer to the buf zone once it no longer has valid contents .