Lines Matching refs:bitmap
556 void *bitmap) in io_ctl_add_entry() argument
566 entry->type = (bitmap) ? BTRFS_FREE_SPACE_BITMAP : in io_ctl_add_entry()
585 static int io_ctl_add_bitmap(struct btrfs_io_ctl *io_ctl, void *bitmap) in io_ctl_add_bitmap() argument
601 copy_page(io_ctl->cur, bitmap); in io_ctl_add_bitmap()
661 copy_page(entry->bitmap, io_ctl->cur); in io_ctl_read_bitmap()
816 e->bitmap = kmem_cache_zalloc( in __load_free_space_cache()
818 if (!e->bitmap) { in __load_free_space_cache()
874 if (!info->bitmap) { in copy_free_space_cache()
1048 e->bitmap); in write_cache_extent_entries()
1052 if (e->bitmap) { in write_cache_extent_entries()
1202 ret = io_ctl_add_bitmap(io_ctl, entry->bitmap); in write_bitmap_entries()
1533 struct rb_node *node, int bitmap) in tree_insert_offset() argument
1561 if (bitmap) { in tree_insert_offset()
1562 if (info->bitmap) { in tree_insert_offset()
1568 if (!info->bitmap) { in tree_insert_offset()
1618 if (entry->bitmap) in tree_search_offset()
1632 WARN_ON(!entry->bitmap); in tree_search_offset()
1635 if (entry->bitmap) { in tree_search_offset()
1644 if (!prev->bitmap && in tree_search_offset()
1671 if (entry->bitmap) { in tree_search_offset()
1676 if (!prev->bitmap && in tree_search_offset()
1689 if (entry->bitmap) { in tree_search_offset()
1713 if (!info->bitmap && !btrfs_free_space_trimmed(info)) { in __unlink_free_space()
1731 ASSERT(info->bytes || info->bitmap); in link_free_space()
1733 &info->offset_index, (info->bitmap != NULL)); in link_free_space()
1737 if (!info->bitmap && !btrfs_free_space_trimmed(info)) { in link_free_space()
1759 bitmap_clear(info->bitmap, start, count); in __bitmap_clear_bits()
1765 if (start && test_bit(start - 1, info->bitmap)) in __bitmap_clear_bits()
1768 if (end < BITS_PER_BITMAP && test_bit(end, info->bitmap)) in __bitmap_clear_bits()
1798 bitmap_set(info->bitmap, start, count); in bitmap_set_bits()
1803 if (start && test_bit(start - 1, info->bitmap)) in bitmap_set_bits()
1806 if (end < BITS_PER_BITMAP && test_bit(end, info->bitmap)) in bitmap_set_bits()
1845 for_each_set_bit_from(i, bitmap_info->bitmap, BITS_PER_BITMAP) { in search_bitmap()
1850 next_zero = find_next_zero_bit(bitmap_info->bitmap, in search_bitmap()
1875 if (entry->bitmap) in get_max_extent_size()
1925 if (entry->bitmap) { in find_free_space()
1977 kmem_cache_free(btrfs_free_space_bitmap_cachep, bitmap_info->bitmap); in free_bitmap()
2037 if (!bitmap_info->bitmap) in remove_from_bitmap()
2191 if (!entry->bitmap) { in insert_into_bitmap()
2230 if (info && info->bitmap) { in insert_into_bitmap()
2250 info->bitmap = kmem_cache_zalloc(btrfs_free_space_bitmap_cachep, in insert_into_bitmap()
2254 if (!info->bitmap) { in insert_into_bitmap()
2263 if (info->bitmap) in insert_into_bitmap()
2265 info->bitmap); in insert_into_bitmap()
2311 if (right_info && !right_info->bitmap && in try_merge_free_space()
2323 if (left_info && !left_info->bitmap && in try_merge_free_space()
2343 struct btrfs_free_space *bitmap; in steal_from_bitmap_to_end() local
2350 bitmap = tree_search_offset(ctl, bitmap_offset, 1, 0); in steal_from_bitmap_to_end()
2351 if (!bitmap) in steal_from_bitmap_to_end()
2354 i = offset_to_bit(bitmap->offset, ctl->unit, end); in steal_from_bitmap_to_end()
2355 j = find_next_zero_bit(bitmap->bitmap, BITS_PER_BITMAP, i); in steal_from_bitmap_to_end()
2362 if (!btrfs_free_space_trimmed(bitmap)) in steal_from_bitmap_to_end()
2366 bitmap_clear_bits(ctl, bitmap, end, bytes); in steal_from_bitmap_to_end()
2368 __bitmap_clear_bits(ctl, bitmap, end, bytes); in steal_from_bitmap_to_end()
2370 if (!bitmap->bytes) in steal_from_bitmap_to_end()
2371 free_bitmap(ctl, bitmap); in steal_from_bitmap_to_end()
2380 struct btrfs_free_space *bitmap; in steal_from_bitmap_to_front() local
2395 bitmap = tree_search_offset(ctl, bitmap_offset, 1, 0); in steal_from_bitmap_to_front()
2396 if (!bitmap) in steal_from_bitmap_to_front()
2399 i = offset_to_bit(bitmap->offset, ctl->unit, info->offset) - 1; in steal_from_bitmap_to_front()
2402 for_each_clear_bit_from(j, bitmap->bitmap, BITS_PER_BITMAP) { in steal_from_bitmap_to_front()
2419 if (!btrfs_free_space_trimmed(bitmap)) in steal_from_bitmap_to_front()
2423 bitmap_clear_bits(ctl, bitmap, info->offset, bytes); in steal_from_bitmap_to_front()
2425 __bitmap_clear_bits(ctl, bitmap, info->offset, bytes); in steal_from_bitmap_to_front()
2427 if (!bitmap->bytes) in steal_from_bitmap_to_front()
2428 free_bitmap(ctl, bitmap); in steal_from_bitmap_to_front()
2452 ASSERT(!info->bitmap); in steal_from_bitmap()
2698 if (!info->bitmap) { in btrfs_remove_free_space()
2783 (info->bitmap) ? "yes" : "no"); in btrfs_dump_free_space()
2839 bool bitmap; in __btrfs_return_cluster_to_free_space() local
2846 bitmap = (entry->bitmap != NULL); in __btrfs_return_cluster_to_free_space()
2847 if (!bitmap) { in __btrfs_return_cluster_to_free_space()
2866 entry->offset, &entry->offset_index, bitmap); in __btrfs_return_cluster_to_free_space()
2881 if (!info->bitmap) { in __btrfs_remove_free_space_cache_locked()
2978 if (entry->bitmap) { in btrfs_find_space_for_alloc()
3122 (!entry->bitmap && entry->offset < min_start)) { in btrfs_alloc_from_cluster()
3131 if (entry->bitmap) { in btrfs_alloc_from_cluster()
3166 if (!entry->bitmap && !btrfs_free_space_trimmed(entry)) in btrfs_alloc_from_cluster()
3173 if (entry->bitmap) { in btrfs_alloc_from_cluster()
3175 entry->bitmap); in btrfs_alloc_from_cluster()
3221 for_each_set_bit_from(i, entry->bitmap, BITS_PER_BITMAP) { in btrfs_bitmap_cluster()
3222 next_zero = find_next_zero_bit(entry->bitmap, in btrfs_bitmap_cluster()
3294 while (entry->bitmap || entry->bytes < min_bytes) { in setup_cluster_no_bitmap()
3295 if (entry->bitmap && list_empty(&entry->list)) in setup_cluster_no_bitmap()
3312 if (entry->bitmap) { in setup_cluster_no_bitmap()
3343 if (entry->bitmap || entry->bytes < min_bytes) in setup_cluster_no_bitmap()
3595 while (entry->bitmap || in trim_no_bitmap()
4022 u64 offset, u64 bytes, bool bitmap) in test_add_free_space_entry() argument
4038 if (!bitmap) { in test_add_free_space_entry()
4062 info->bitmap = map; in test_add_free_space_entry()
4108 if (info->bitmap) { in test_check_exists()