FreeBSD/sys/kern/subr_blist.c
/*
 * BLST_LEAF_FREE() -	free allocated block from leaf bitmap
 *
 */
free allocated block from leaf bitmap
free allocated block from leaf bitmap
static void
blst_leaf_free(
	blmeta_t *scan,
	daddr_t blk,
	int count
) {
	int n = blk & (BLIST_BMAP_RADIX - 1);
	u_daddr_t mask;
	mask = ((u_daddr_t)-1 << n) &
	    ((u_daddr_t)-1 >> (BLIST_BMAP_RADIX - count - n));
	if (scan->u.bmu_bitmap & mask)
		panic("blst_radix_free: freeing free block");
	scan->u.bmu_bitmap |= mask;
	scan->bm_bighint = BLIST_BMAP_RADIX;
}
static void blst_leaf_free ( blmeta_t * scan , daddr_t blk , int count ) { int n = blk & ( BLIST_BMAP_RADIX - 1 ) ; u_daddr_t mask ; mask = ( ( u_daddr_t ) - 1 << n ) & ( ( u_daddr_t ) - 1 >> ( BLIST_BMAP_RADIX - count - n ) ) ; if ( scan -> u . bmu_bitmap & mask ) panic ( " " ) ; scan -> u . bmu_bitmap |= mask ; scan -> bm_bighint = BLIST_BMAP_RADIX ; }
BLST_LEAF_FREE() -   free allocated block from leaf bitmap
BLST_LEAF_FREE () - free allocated block from leaf bitmap
/*
	 * free some data in this bitmap
	 *
	 * e.g.
	 *	0000111111111110000
	 *          \_________/\__/
	 *		v        n
	 */ /*
	 * We could probably do a better job here.  We are required to make
	 * bighint at least as large as the biggest contiguous block of 
	 * data.  If we just shoehorn it, a little extra overhead will
	 * be incured on the next allocation (but only that one typically).
	 */