Lines Matching defs:blocks

196 /* Marks a the first num_blocks blocks in a block group as used, and accounts
244 /* Reduces an existing allocation by len blocks by return the last blocks
245 to the free pool in their block group. Assumes that the blocks being
302 error("failed to reserve %u blocks in block group %u\n", bg->header_blocks, i);
340 error("failed to reserve %u blocks in block group %u\n", len, bg_num);
405 error("failed to allocate %d blocks in block group %d", bg_len, i);
459 /* Allocate len blocks. The blocks may be spread across multiple block groups,
460 and are returned in a linked list of the blocks in each block group. The
464 blocks as possible into each block group that is completely empty
465 3. Put the last set of blocks in the first block group they fit in
532 /* Gets the starting block and length in blocks of the first region
547 /* Returns the number of free blocks in a block group */
606 /* Then split off len blocks */
612 /* Reserve the next blocks for oob data (indirect or extent blocks) */
613 int reserve_oob_blocks(struct block_allocation *alloc, int blocks)
615 struct region *oob = split_allocation(alloc, blocks);
631 static int advance_list_ptr(struct region_list *list, int blocks)
635 while (reg != NULL && blocks > 0) {
636 if (reg->len > list->partial_iter + blocks) {
637 list->partial_iter += blocks;
641 blocks -= (reg->len - list->partial_iter);
646 if (blocks > 0)
653 int advance_blocks(struct block_allocation *alloc, int blocks)
655 return advance_list_ptr(&alloc->list, blocks);
658 int advance_oob_blocks(struct block_allocation *alloc, int blocks)
660 return advance_list_ptr(&alloc->oob_list, blocks);
668 error("failed to allocate %d blocks", len);