Lines Matching refs:nr_regions
122 unsigned long nr_regions; member
381 cmd->nr_regions, false, &cmd->bitset_root); in __format_metadata()
383 DMERR("Failed to resize on-disk bitset to %lu entries", cmd->nr_regions); in __format_metadata()
474 unsigned long nr_regions) in __dirty_map_init() argument
482 dmap->dirty_regions = kvzalloc(bitmap_size(nr_regions), GFP_KERNEL); in __dirty_map_init()
499 if (__dirty_map_init(&cmd->dmap[0], cmd->nr_words, cmd->nr_regions)) { in dirty_map_init()
504 if (__dirty_map_init(&cmd->dmap[1], cmd->nr_words, cmd->nr_regions)) { in dirty_map_init()
533 r = dm_bitset_cursor_begin(&cmd->bitset_info, cmd->bitset_root, cmd->nr_regions, &c); in __load_bitset_in_core()
543 if (i >= (cmd->nr_regions - 1)) in __load_bitset_in_core()
573 cmd->nr_regions = dm_sector_div_up(cmd->target_size, cmd->region_size); in dm_clone_metadata_open()
574 cmd->nr_words = BITS_TO_LONGS(cmd->nr_regions); in dm_clone_metadata_open()
582 cmd->region_map = kvmalloc(bitmap_size(cmd->nr_regions), GFP_KERNEL); in dm_clone_metadata_open()
603 if (bitmap_full(cmd->region_map, cmd->nr_regions)) in dm_clone_metadata_open()
641 unsigned long start, unsigned long nr_regions) in dm_clone_is_range_hydrated() argument
648 bit = find_next_zero_bit(cmd->region_map, cmd->nr_regions, start); in dm_clone_is_range_hydrated()
650 return (bit >= (start + nr_regions)); in dm_clone_is_range_hydrated()
655 return bitmap_weight(cmd->region_map, cmd->nr_regions); in dm_clone_nr_of_hydrated_regions()
661 return find_next_zero_bit(cmd->region_map, cmd->nr_regions, start); in dm_clone_find_next_unhydrated_region()
670 unsigned long max_index = min(cmd->nr_regions, (word + 1) * BITS_PER_LONG); in __update_metadata_word()
736 if (bitmap_full(cmd->region_map, cmd->nr_regions)) in __metadata_commit()
847 if (unlikely(region_nr >= cmd->nr_regions)) { in dm_clone_set_region_hydrated()
849 region_nr, cmd->nr_regions); in dm_clone_set_region_hydrated()
876 unsigned long nr_regions) in dm_clone_cond_set_range() argument
882 if (unlikely(start >= cmd->nr_regions || (start + nr_regions) < start || in dm_clone_cond_set_range()
883 (start + nr_regions) > cmd->nr_regions)) { in dm_clone_cond_set_range()
885 start, nr_regions, cmd->nr_regions); in dm_clone_cond_set_range()
897 for (region_nr = start; region_nr < (start + nr_regions); region_nr++) { in dm_clone_cond_set_range()