Lines Matching refs:bitmap
517 void *bitmap) in io_ctl_add_entry() argument
527 entry->type = (bitmap) ? BTRFS_FREE_SPACE_BITMAP : in io_ctl_add_entry()
546 static int io_ctl_add_bitmap(struct btrfs_io_ctl *io_ctl, void *bitmap) in io_ctl_add_bitmap() argument
562 copy_page(io_ctl->cur, bitmap); in io_ctl_add_bitmap()
622 copy_page(entry->bitmap, io_ctl->cur); in io_ctl_read_bitmap()
648 if (e->bitmap || prev->bitmap) in merge_space_tree()
787 e->bitmap = kmem_cache_zalloc( in __load_free_space_cache()
789 if (!e->bitmap) { in __load_free_space_cache()
976 e->bitmap); in write_cache_extent_entries()
980 if (e->bitmap) { in write_cache_extent_entries()
1130 ret = io_ctl_add_bitmap(io_ctl, entry->bitmap); in write_bitmap_entries()
1466 struct rb_node *node, int bitmap) in tree_insert_offset() argument
1494 if (bitmap) { in tree_insert_offset()
1495 if (info->bitmap) { in tree_insert_offset()
1501 if (!info->bitmap) { in tree_insert_offset()
1551 if (entry->bitmap) in tree_search_offset()
1565 WARN_ON(!entry->bitmap); in tree_search_offset()
1568 if (entry->bitmap) { in tree_search_offset()
1577 if (!prev->bitmap && in tree_search_offset()
1604 if (entry->bitmap) { in tree_search_offset()
1609 if (!prev->bitmap && in tree_search_offset()
1622 if (entry->bitmap) { in tree_search_offset()
1646 if (!info->bitmap && !btrfs_free_space_trimmed(info)) { in __unlink_free_space()
1664 ASSERT(info->bytes || info->bitmap); in link_free_space()
1666 &info->offset_index, (info->bitmap != NULL)); in link_free_space()
1670 if (!info->bitmap && !btrfs_free_space_trimmed(info)) { in link_free_space()
1730 bitmap_clear(info->bitmap, start, count); in __bitmap_clear_bits()
1736 if (start && test_bit(start - 1, info->bitmap)) in __bitmap_clear_bits()
1739 if (end < BITS_PER_BITMAP && test_bit(end, info->bitmap)) in __bitmap_clear_bits()
1769 bitmap_set(info->bitmap, start, count); in bitmap_set_bits()
1774 if (start && test_bit(start - 1, info->bitmap)) in bitmap_set_bits()
1777 if (end < BITS_PER_BITMAP && test_bit(end, info->bitmap)) in bitmap_set_bits()
1816 for_each_set_bit_from(i, bitmap_info->bitmap, BITS_PER_BITMAP) { in search_bitmap()
1821 next_zero = find_next_zero_bit(bitmap_info->bitmap, in search_bitmap()
1846 if (entry->bitmap) in get_max_extent_size()
1896 if (entry->bitmap) { in find_free_space()
1931 bitmap_for_each_set_region(bitmap_info->bitmap, rs, re, 0, in count_bitmap_extents()
1972 kmem_cache_free(btrfs_free_space_bitmap_cachep, bitmap_info->bitmap); in free_bitmap()
2032 if (!bitmap_info->bitmap) in remove_from_bitmap()
2187 if (!entry->bitmap) { in insert_into_bitmap()
2226 if (info && info->bitmap) { in insert_into_bitmap()
2246 info->bitmap = kmem_cache_zalloc(btrfs_free_space_bitmap_cachep, in insert_into_bitmap()
2250 if (!info->bitmap) { in insert_into_bitmap()
2259 if (info->bitmap) in insert_into_bitmap()
2261 info->bitmap); in insert_into_bitmap()
2307 if (right_info && !right_info->bitmap && in try_merge_free_space()
2319 if (left_info && !left_info->bitmap && in try_merge_free_space()
2339 struct btrfs_free_space *bitmap; in steal_from_bitmap_to_end() local
2346 bitmap = tree_search_offset(ctl, bitmap_offset, 1, 0); in steal_from_bitmap_to_end()
2347 if (!bitmap) in steal_from_bitmap_to_end()
2350 i = offset_to_bit(bitmap->offset, ctl->unit, end); in steal_from_bitmap_to_end()
2351 j = find_next_zero_bit(bitmap->bitmap, BITS_PER_BITMAP, i); in steal_from_bitmap_to_end()
2358 if (!btrfs_free_space_trimmed(bitmap)) in steal_from_bitmap_to_end()
2362 bitmap_clear_bits(ctl, bitmap, end, bytes); in steal_from_bitmap_to_end()
2364 __bitmap_clear_bits(ctl, bitmap, end, bytes); in steal_from_bitmap_to_end()
2366 if (!bitmap->bytes) in steal_from_bitmap_to_end()
2367 free_bitmap(ctl, bitmap); in steal_from_bitmap_to_end()
2376 struct btrfs_free_space *bitmap; in steal_from_bitmap_to_front() local
2391 bitmap = tree_search_offset(ctl, bitmap_offset, 1, 0); in steal_from_bitmap_to_front()
2392 if (!bitmap) in steal_from_bitmap_to_front()
2395 i = offset_to_bit(bitmap->offset, ctl->unit, info->offset) - 1; in steal_from_bitmap_to_front()
2398 for_each_clear_bit_from(j, bitmap->bitmap, BITS_PER_BITMAP) { in steal_from_bitmap_to_front()
2415 if (!btrfs_free_space_trimmed(bitmap)) in steal_from_bitmap_to_front()
2419 bitmap_clear_bits(ctl, bitmap, info->offset, bytes); in steal_from_bitmap_to_front()
2421 __bitmap_clear_bits(ctl, bitmap, info->offset, bytes); in steal_from_bitmap_to_front()
2423 if (!bitmap->bytes) in steal_from_bitmap_to_front()
2424 free_bitmap(ctl, bitmap); in steal_from_bitmap_to_front()
2448 ASSERT(!info->bitmap); in steal_from_bitmap()
2599 if (!info->bitmap) { in btrfs_remove_free_space()
2673 (info->bitmap) ? "yes" : "no"); in btrfs_dump_free_space()
2729 bool bitmap; in __btrfs_return_cluster_to_free_space() local
2736 bitmap = (entry->bitmap != NULL); in __btrfs_return_cluster_to_free_space()
2737 if (!bitmap) { in __btrfs_return_cluster_to_free_space()
2756 entry->offset, &entry->offset_index, bitmap); in __btrfs_return_cluster_to_free_space()
2771 if (!info->bitmap) { in __btrfs_remove_free_space_cache_locked()
2866 if (entry->bitmap) { in btrfs_find_space_for_alloc()
3008 (!entry->bitmap && entry->offset < min_start)) { in btrfs_alloc_from_cluster()
3017 if (entry->bitmap) { in btrfs_alloc_from_cluster()
3052 if (!entry->bitmap && !btrfs_free_space_trimmed(entry)) in btrfs_alloc_from_cluster()
3059 if (entry->bitmap) { in btrfs_alloc_from_cluster()
3061 entry->bitmap); in btrfs_alloc_from_cluster()
3107 for_each_set_bit_from(i, entry->bitmap, BITS_PER_BITMAP) { in btrfs_bitmap_cluster()
3108 next_zero = find_next_zero_bit(entry->bitmap, in btrfs_bitmap_cluster()
3180 while (entry->bitmap || entry->bytes < min_bytes) { in setup_cluster_no_bitmap()
3181 if (entry->bitmap && list_empty(&entry->list)) in setup_cluster_no_bitmap()
3198 if (entry->bitmap) { in setup_cluster_no_bitmap()
3229 if (entry->bitmap || entry->bytes < min_bytes) in setup_cluster_no_bitmap()
3481 while (entry->bitmap || in trim_no_bitmap()
3859 if (!entry->bitmap) { in btrfs_find_ino_for_alloc()
4010 u64 offset, u64 bytes, bool bitmap) in test_add_free_space_entry() argument
4026 if (!bitmap) { in test_add_free_space_entry()
4050 info->bitmap = map; in test_add_free_space_entry()
4096 if (info->bitmap) { in test_check_exists()