Lines Matching refs:nr_regions
122 unsigned long nr_regions; member
387 cmd->nr_regions, false, &cmd->bitset_root); in __format_metadata()
389 DMERR("Failed to resize on-disk bitset to %lu entries", cmd->nr_regions); in __format_metadata()
480 unsigned long nr_regions) in __dirty_map_init() argument
488 dmap->dirty_regions = kvzalloc(bitmap_size(nr_regions), GFP_KERNEL); in __dirty_map_init()
505 if (__dirty_map_init(&cmd->dmap[0], cmd->nr_words, cmd->nr_regions)) { in dirty_map_init()
510 if (__dirty_map_init(&cmd->dmap[1], cmd->nr_words, cmd->nr_regions)) { in dirty_map_init()
539 r = dm_bitset_cursor_begin(&cmd->bitset_info, cmd->bitset_root, cmd->nr_regions, &c); in __load_bitset_in_core()
549 if (i >= (cmd->nr_regions - 1)) in __load_bitset_in_core()
579 cmd->nr_regions = dm_sector_div_up(cmd->target_size, cmd->region_size); in dm_clone_metadata_open()
580 cmd->nr_words = BITS_TO_LONGS(cmd->nr_regions); in dm_clone_metadata_open()
588 cmd->region_map = kvmalloc(bitmap_size(cmd->nr_regions), GFP_KERNEL); in dm_clone_metadata_open()
609 if (bitmap_full(cmd->region_map, cmd->nr_regions)) in dm_clone_metadata_open()
647 unsigned long start, unsigned long nr_regions) in dm_clone_is_range_hydrated() argument
654 bit = find_next_zero_bit(cmd->region_map, cmd->nr_regions, start); in dm_clone_is_range_hydrated()
656 return (bit >= (start + nr_regions)); in dm_clone_is_range_hydrated()
661 return bitmap_weight(cmd->region_map, cmd->nr_regions); in dm_clone_nr_of_hydrated_regions()
667 return find_next_zero_bit(cmd->region_map, cmd->nr_regions, start); in dm_clone_find_next_unhydrated_region()
676 unsigned long max_index = min(cmd->nr_regions, (word + 1) * BITS_PER_LONG); in __update_metadata_word()
742 if (bitmap_full(cmd->region_map, cmd->nr_regions)) in __metadata_commit()
853 if (unlikely(region_nr >= cmd->nr_regions)) { in dm_clone_set_region_hydrated()
855 region_nr, cmd->nr_regions); in dm_clone_set_region_hydrated()
882 unsigned long nr_regions) in dm_clone_cond_set_range() argument
888 if (unlikely(start >= cmd->nr_regions || (start + nr_regions) < start || in dm_clone_cond_set_range()
889 (start + nr_regions) > cmd->nr_regions)) { in dm_clone_cond_set_range()
891 start, nr_regions, cmd->nr_regions); in dm_clone_cond_set_range()
903 for (region_nr = start; region_nr < (start + nr_regions); region_nr++) { in dm_clone_cond_set_range()