Lines Matching refs:blocks
113 printf("%p: Blocks %d-%d (%d)\n", reg,
194 /* Marks a the first num_blocks blocks in a block group as used, and accounts
242 /* Reduces an existing allocation by len blocks by return the last blocks
243 to the free pool in their block group. Assumes that the blocks being
299 error("failed to reserve %u blocks in block group %u\n", bg->header_blocks, i);
337 error("failed to reserve %u blocks in block group %u\n", len, bg_num);
402 error("failed to allocate %d blocks in block group %d", bg_len, i);
456 /* Allocate len blocks. The blocks may be spread across multiple block groups,
457 and are returned in a linked list of the blocks in each block group. The
461 blocks as possible into each block group that is completely empty
462 3. Put the last set of blocks in the first block group they fit in
529 /* Gets the starting block and length in blocks of the first region
544 /* Returns the number of free blocks in a block group */
603 /* Then split off len blocks */
609 /* Reserve the next blocks for oob data (indirect or extent blocks) */
610 int reserve_oob_blocks(struct block_allocation *alloc, int blocks)
612 struct region *oob = split_allocation(alloc, blocks);
628 static int advance_list_ptr(struct region_list *list, int blocks)
632 while (reg != NULL && blocks > 0) {
633 if (reg->len > list->partial_iter + blocks) {
634 list->partial_iter += blocks;
638 blocks -= (reg->len - list->partial_iter);
643 if (blocks > 0)
650 int advance_blocks(struct block_allocation *alloc, int blocks)
652 return advance_list_ptr(&alloc->list, blocks);
655 int advance_oob_blocks(struct block_allocation *alloc, int blocks)
657 return advance_list_ptr(&alloc->oob_list, blocks);
665 error("failed to allocate %d blocks", len);