FreeBSD/sys/kern/subr_mbpool.c
/*
 * Free all buffers that are marked as being on the card
 */
Free all buffers that are marked as being on the card
Free all buffers that are marked as being on the card
void
mbp_card_free(struct mbpool *p)
{
	u_int i, b;
	struct mbpage *pg;
	struct mbtrail *tr;
	struct mbfree *cf;
	mtx_lock(&p->free_lock);
	for (i = 0; i < p->npages; i++) {
		pg = &p->pages[i];
		for (b = 0; b < p->nchunks; b++) {
			cf = N2C(p, pg, b);
			tr = C2T(p, cf);
			if (tr->page & MBP_CARD) {
				tr->page &= MBP_PMSK;
				SLIST_INSERT_HEAD(&p->free_list, cf, link);
			}
		}
	}
	mtx_unlock(&p->free_lock);
}
void mbp_card_free ( struct mbpool * p ) { u_int i , b ; struct mbpage * pg ; struct mbtrail * tr ; struct mbfree * cf ; mtx_lock ( & p -> free_lock ) ; for ( i = 0 ; i < p -> npages ; i ++ ) { pg = & p -> pages [ i ] ; for ( b = 0 ; b < p -> nchunks ; b ++ ) { cf = N2C ( p , pg , b ) ; tr = C2T ( p , cf ) ; if ( tr -> page & MBP_CARD ) { tr -> page &= MBP_PMSK ; SLIST_INSERT_HEAD ( & p -> free_list , cf , link ) ; } } } mtx_unlock ( & p -> free_lock ) ; }
Free all buffers that are marked as being on the card
Free all buffers that are marked as being on the card