Lines Matching refs:bitmap
521 void *bitmap) in io_ctl_add_entry() argument
531 entry->type = (bitmap) ? BTRFS_FREE_SPACE_BITMAP : in io_ctl_add_entry()
550 static int io_ctl_add_bitmap(struct btrfs_io_ctl *io_ctl, void *bitmap) in io_ctl_add_bitmap() argument
566 memcpy(io_ctl->cur, bitmap, PAGE_CACHE_SIZE); in io_ctl_add_bitmap()
626 memcpy(entry->bitmap, io_ctl->cur, PAGE_CACHE_SIZE); in io_ctl_read_bitmap()
652 if (e->bitmap || prev->bitmap) in merge_space_tree()
780 e->bitmap = kzalloc(PAGE_CACHE_SIZE, GFP_NOFS); in __load_free_space_cache()
781 if (!e->bitmap) { in __load_free_space_cache()
939 e->bitmap); in write_cache_extent_entries()
943 if (e->bitmap) { in write_cache_extent_entries()
1099 ret = io_ctl_add_bitmap(io_ctl, entry->bitmap); in write_bitmap_entries()
1438 struct rb_node *node, int bitmap) in tree_insert_offset() argument
1466 if (bitmap) { in tree_insert_offset()
1467 if (info->bitmap) { in tree_insert_offset()
1473 if (!info->bitmap) { in tree_insert_offset()
1523 if (entry->bitmap) in tree_search_offset()
1537 WARN_ON(!entry->bitmap); in tree_search_offset()
1540 if (entry->bitmap) { in tree_search_offset()
1549 if (!prev->bitmap && in tree_search_offset()
1576 if (entry->bitmap) { in tree_search_offset()
1581 if (!prev->bitmap && in tree_search_offset()
1594 if (entry->bitmap) { in tree_search_offset()
1631 ASSERT(info->bytes || info->bitmap); in link_free_space()
1633 &info->offset_index, (info->bitmap != NULL)); in link_free_space()
1700 bitmap_clear(info->bitmap, start, count); in __bitmap_clear_bits()
1723 bitmap_set(info->bitmap, start, count); in bitmap_set_bits()
1747 for_each_set_bit_from(i, bitmap_info->bitmap, BITS_PER_BITMAP) { in search_bitmap()
1748 next_zero = find_next_zero_bit(bitmap_info->bitmap, in search_bitmap()
1815 if (entry->bitmap) { in find_free_space()
1853 kfree(bitmap_info->bitmap); in free_bitmap()
1912 if (!bitmap_info->bitmap) in remove_from_bitmap()
2035 if (!entry->bitmap) { in insert_into_bitmap()
2073 if (info && info->bitmap) { in insert_into_bitmap()
2093 info->bitmap = kzalloc(PAGE_CACHE_SIZE, GFP_NOFS); in insert_into_bitmap()
2095 if (!info->bitmap) { in insert_into_bitmap()
2104 if (info->bitmap) in insert_into_bitmap()
2105 kfree(info->bitmap); in insert_into_bitmap()
2133 if (right_info && !right_info->bitmap) { in try_merge_free_space()
2143 if (left_info && !left_info->bitmap && in try_merge_free_space()
2162 struct btrfs_free_space *bitmap; in steal_from_bitmap_to_end() local
2169 bitmap = tree_search_offset(ctl, bitmap_offset, 1, 0); in steal_from_bitmap_to_end()
2170 if (!bitmap) in steal_from_bitmap_to_end()
2173 i = offset_to_bit(bitmap->offset, ctl->unit, end); in steal_from_bitmap_to_end()
2174 j = find_next_zero_bit(bitmap->bitmap, BITS_PER_BITMAP, i); in steal_from_bitmap_to_end()
2181 bitmap_clear_bits(ctl, bitmap, end, bytes); in steal_from_bitmap_to_end()
2183 __bitmap_clear_bits(ctl, bitmap, end, bytes); in steal_from_bitmap_to_end()
2185 if (!bitmap->bytes) in steal_from_bitmap_to_end()
2186 free_bitmap(ctl, bitmap); in steal_from_bitmap_to_end()
2195 struct btrfs_free_space *bitmap; in steal_from_bitmap_to_front() local
2210 bitmap = tree_search_offset(ctl, bitmap_offset, 1, 0); in steal_from_bitmap_to_front()
2211 if (!bitmap) in steal_from_bitmap_to_front()
2214 i = offset_to_bit(bitmap->offset, ctl->unit, info->offset) - 1; in steal_from_bitmap_to_front()
2217 for_each_clear_bit_from(j, bitmap->bitmap, BITS_PER_BITMAP) { in steal_from_bitmap_to_front()
2234 bitmap_clear_bits(ctl, bitmap, info->offset, bytes); in steal_from_bitmap_to_front()
2236 __bitmap_clear_bits(ctl, bitmap, info->offset, bytes); in steal_from_bitmap_to_front()
2238 if (!bitmap->bytes) in steal_from_bitmap_to_front()
2239 free_bitmap(ctl, bitmap); in steal_from_bitmap_to_front()
2263 ASSERT(!info->bitmap); in steal_from_bitmap()
2369 if (!info->bitmap) { in btrfs_remove_free_space()
2439 (info->bitmap) ? "yes" : "no"); in btrfs_dump_free_space()
2493 bool bitmap; in __btrfs_return_cluster_to_free_space() local
2500 bitmap = (entry->bitmap != NULL); in __btrfs_return_cluster_to_free_space()
2501 if (!bitmap) { in __btrfs_return_cluster_to_free_space()
2506 entry->offset, &entry->offset_index, bitmap); in __btrfs_return_cluster_to_free_space()
2524 if (!info->bitmap) { in __btrfs_remove_free_space_cache_locked()
2582 if (entry->bitmap) { in btrfs_find_space_for_alloc()
2710 (!entry->bitmap && entry->offset < min_start)) { in btrfs_alloc_from_cluster()
2719 if (entry->bitmap) { in btrfs_alloc_from_cluster()
2755 if (entry->bitmap) { in btrfs_alloc_from_cluster()
2756 kfree(entry->bitmap); in btrfs_alloc_from_cluster()
2791 for_each_set_bit_from(i, entry->bitmap, BITS_PER_BITMAP) { in btrfs_bitmap_cluster()
2792 next_zero = find_next_zero_bit(entry->bitmap, in btrfs_bitmap_cluster()
2858 while (entry->bitmap || entry->bytes < min_bytes) { in setup_cluster_no_bitmap()
2859 if (entry->bitmap && list_empty(&entry->list)) in setup_cluster_no_bitmap()
2876 if (entry->bitmap) { in setup_cluster_no_bitmap()
2907 if (entry->bitmap || entry->bytes < min_bytes) in setup_cluster_no_bitmap()
3142 while (entry->bitmap) { in trim_no_bitmap()
3357 if (!entry->bitmap) { in btrfs_find_ino_for_alloc()
3509 u64 offset, u64 bytes, bool bitmap) in test_add_free_space_entry() argument
3524 if (!bitmap) { in test_add_free_space_entry()
3547 info->bitmap = map; in test_add_free_space_entry()
3591 if (info->bitmap) { in test_check_exists()