/* create_bm_block_list - create a list of block bitmap objects @pages - number of pages to track @list - list to put the allocated blocks into @ca - chain allocator to be used for allocating memory  */
static int create_bm_block_list(unsigned long pages, struct list_head *list, struct chain_allocator *ca)
/* create_bm_block_list - create a list of block bitmap objects @pages - number of pages to track @list - list to put the allocated blocks into @ca - chain allocator to be used for allocating memory  */
static int create_bm_block_list(unsigned long pages, struct list_head *list, struct chain_allocator *ca)
{
	unsigned int nr_blocks = DIV_ROUND_UP(pages, BM_BITS_PER_BLOCK);
	while (nr_blocks-- > 0) {
		struct bm_block *bb;
		bb = chain_alloc(ca, sizeof(struct bm_block));
		if (!bb)
			return -ENOMEM;
		list_add(&bb->hook, list);
	}
	return 0;
}