Lines Matching refs:blocks
140 printf("%p: Blocks %d-%d (%d)\n", reg,
206 /* Marks a the first num_blocks blocks in a block group as used, and accounts
254 /* Reduces an existing allocation by len blocks by return the last blocks
255 to the free pool in their block group. Assumes that the blocks being
313 error("failed to reserve %u blocks in block group %u\n", bg->header_blocks, i);
351 error("failed to reserve %u blocks in block group %u\n", len, bg_num);
416 error("failed to allocate %d blocks in block group %d", bg_len, i);
470 /* Allocate len blocks. The blocks may be spread across multiple block groups,
471 and are returned in a linked list of the blocks in each block group. The
475 blocks as possible into each block group that is completely empty
476 3. Put the last set of blocks in the first block group they fit in
543 /* Gets the starting block and length in blocks of the first region
558 /* Returns the number of free blocks in a block group */
617 /* Then split off len blocks */
623 /* Reserve the next blocks for oob data (indirect or extent blocks) */
624 int reserve_oob_blocks(struct block_allocation *alloc, int blocks)
626 struct region *oob = split_allocation(alloc, blocks);
642 static int advance_list_ptr(struct region_list *list, int blocks)
646 while (reg != NULL && blocks > 0) {
647 if (reg->len > list->partial_iter + blocks) {
648 list->partial_iter += blocks;
652 blocks -= (reg->len - list->partial_iter);
657 if (blocks > 0)
664 int advance_blocks(struct block_allocation *alloc, int blocks)
666 return advance_list_ptr(&alloc->list, blocks);
669 int advance_oob_blocks(struct block_allocation *alloc, int blocks)
671 return advance_list_ptr(&alloc->oob_list, blocks);
679 error("failed to allocate %d blocks", len);