/* block to be freed better be within the mapsize. */
if (unlikely((blkno == 0) || (blkno + nblocks > bmp->db_mapsize))) {
/* block to be freed better be within the mapsize. */
if (unlikely((blkno == 0) || (blkno + nblocks > bmp->db_mapsize))) {
* allocation group size, try to allocate anywhere.
*/
if (l2nb > bmp->db_agl2size) {
* allocation group size, try to allocate anywhere.
*/
if (l2nb > bmp->db_agl2size) {
rc = dbAllocAny(bmp, nblocks, l2nb, results);
rc = dbAllocAny(bmp, nblocks, l2nb, results);
if ((rc = dbAllocAG(bmp, agno, nblocks, l2nb, results)) != -ENOSPC)
goto write_unlock;
if ((rc = dbAllocAG(bmp, agno, nblocks, l2nb, results)) != -ENOSPC)
goto write_unlock;
/* Try to allocate within this allocation group. if that fails, try to
* allocate anywhere in the map.
/* Try to allocate within this allocation group. if that fails, try to
* allocate anywhere in the map.
/* block to be allocated better be within the mapsize. */
ASSERT(nblocks <= bmp->db_mapsize - blkno);
/* block to be allocated better be within the mapsize. */
ASSERT(nblocks <= bmp->db_mapsize - blkno);