FreeBSD/sys/kern/subr_blist.c
/*
 * blist_alloc() - reserve space in the block bitmap.  Return the base
 *		     of a contiguous region or SWAPBLK_NONE if space could
 *		     not be allocated.
 */
reserve space in the block bitmap.  Return the base
of a contiguous region or SWAPBLK_NONE if space could
not be allocated.
reserve space in the block bitmap . Return the base of a contiguous region or SWAPBLK_NONE if space could not be allocated .
daddr_t 
blist_alloc(blist_t bl, daddr_t count)
{
	daddr_t blk = SWAPBLK_NONE;
	if (bl) {
		if (bl->bl_radix == BLIST_BMAP_RADIX)
			blk = blst_leaf_alloc(bl->bl_root, 0, count);
		else
			blk = blst_meta_alloc(bl->bl_root, 0, count, bl->bl_radix, bl->bl_skip);
		if (blk != SWAPBLK_NONE)
			bl->bl_free -= count;
	}
	return(blk);
}
daddr_t blist_alloc ( blist_t bl , daddr_t count ) { daddr_t blk = SWAPBLK_NONE ; if ( bl ) { if ( bl -> bl_radix == BLIST_BMAP_RADIX ) blk = blst_leaf_alloc ( bl -> bl_root , 0 , count ) ; else blk = blst_meta_alloc ( bl -> bl_root , 0 , count , bl -> bl_radix , bl -> bl_skip ) ; if ( blk != SWAPBLK_NONE ) bl -> bl_free -= count ; } return ( blk ) ; }
blist_alloc() - reserve space in the block bitmap.
blist_alloc () - reserve space in the block bitmap .