Lines Matching refs:info
77 static int btrfs_add_block_group_cache(struct btrfs_fs_info *info, in btrfs_add_block_group_cache() argument
84 spin_lock(&info->block_group_cache_lock); in btrfs_add_block_group_cache()
85 p = &info->block_group_cache_tree.rb_node; in btrfs_add_block_group_cache()
96 spin_unlock(&info->block_group_cache_lock); in btrfs_add_block_group_cache()
103 &info->block_group_cache_tree); in btrfs_add_block_group_cache()
104 spin_unlock(&info->block_group_cache_lock); in btrfs_add_block_group_cache()
114 block_group_cache_tree_search(struct btrfs_fs_info *info, u64 bytenr, in block_group_cache_tree_search() argument
121 spin_lock(&info->block_group_cache_lock); in block_group_cache_tree_search()
122 n = info->block_group_cache_tree.rb_node; in block_group_cache_tree_search()
147 spin_unlock(&info->block_group_cache_lock); in block_group_cache_tree_search()
158 struct btrfs_fs_info *info, u64 start, u64 end) in add_new_free_space() argument
163 mutex_lock(&info->pinned_mutex); in add_new_free_space()
165 ret = find_first_extent_bit(&info->pinned_extents, start, in add_new_free_space()
189 mutex_unlock(&info->pinned_mutex); in add_new_free_space()
300 btrfs_lookup_first_block_group(struct btrfs_fs_info *info, u64 bytenr) in btrfs_lookup_first_block_group() argument
304 cache = block_group_cache_tree_search(info, bytenr, 0); in btrfs_lookup_first_block_group()
313 struct btrfs_fs_info *info, in btrfs_lookup_block_group() argument
318 cache = block_group_cache_tree_search(info, bytenr, 1); in btrfs_lookup_block_group()
329 static struct btrfs_space_info *__find_space_info(struct btrfs_fs_info *info, in __find_space_info() argument
332 struct list_head *head = &info->space_info; in __find_space_info()
350 void btrfs_clear_space_info_full(struct btrfs_fs_info *info) in btrfs_clear_space_info_full() argument
352 struct list_head *head = &info->space_info; in btrfs_clear_space_info_full()
568 struct btrfs_fs_info *info = extent_root->fs_info; in update_backrefs() local
617 unlock_extent(&info->extent_ins, op->bytenr, in update_backrefs()
656 struct btrfs_fs_info *info = extent_root->fs_info; in insert_extents() local
737 unlock_extent(&info->extent_ins, op->bytenr, in insert_extents()
934 struct btrfs_fs_info *info = extent_root->fs_info; in free_extents() local
1034 mutex_lock(&info->pinned_mutex); in free_extents()
1038 mutex_unlock(&info->pinned_mutex); in free_extents()
1082 mutex_lock(&info->pinned_mutex); in free_extents()
1086 mutex_unlock(&info->pinned_mutex); in free_extents()
1102 spin_lock(&info->delalloc_lock); in free_extents()
1103 super_used = btrfs_super_bytes_used(&info->super_copy); in free_extents()
1104 btrfs_set_super_bytes_used(&info->super_copy, in free_extents()
1110 spin_unlock(&info->delalloc_lock); in free_extents()
1136 unlock_extent(&info->extent_ins, tmp->bytenr, in free_extents()
1151 unlock_extent(&info->extent_ins, op->bytenr, in free_extents()
1161 unlock_extent(&info->extent_ins, op->bytenr, in free_extents()
1514 struct btrfs_extent_info *info; in btrfs_cache_ref() local
1527 info = ref->extents; in btrfs_cache_ref()
1543 info->bytenr = disk_bytenr; in btrfs_cache_ref()
1544 info->num_bytes = in btrfs_cache_ref()
1546 info->objectid = key.objectid; in btrfs_cache_ref()
1547 info->offset = key.offset; in btrfs_cache_ref()
1548 info++; in btrfs_cache_ref()
1907 static int update_space_info(struct btrfs_fs_info *info, u64 flags, in update_space_info() argument
1913 found = __find_space_info(info, flags); in update_space_info()
1940 list_add_rcu(&found->list, &info->space_info); in update_space_info()
2003 struct btrfs_fs_info *info = root->fs_info; in btrfs_get_alloc_profile() local
2007 alloc_profile = info->avail_data_alloc_bits & in btrfs_get_alloc_profile()
2008 info->data_alloc_profile; in btrfs_get_alloc_profile()
2011 alloc_profile = info->avail_system_alloc_bits & in btrfs_get_alloc_profile()
2012 info->system_alloc_profile; in btrfs_get_alloc_profile()
2015 alloc_profile = info->avail_metadata_alloc_bits & in btrfs_get_alloc_profile()
2016 info->metadata_alloc_profile; in btrfs_get_alloc_profile()
2038 struct btrfs_fs_info *info = root->fs_info; in btrfs_check_metadata_free_space() local
2045 meta_sinfo = __find_space_info(info, alloc_target); in btrfs_check_metadata_free_space()
2219 struct btrfs_space_info *info; in btrfs_delalloc_free_space() local
2221 info = BTRFS_I(inode)->space_info; in btrfs_delalloc_free_space()
2223 spin_lock(&info->lock); in btrfs_delalloc_free_space()
2224 info->bytes_delalloc -= bytes; in btrfs_delalloc_free_space()
2225 spin_unlock(&info->lock); in btrfs_delalloc_free_space()
2282 struct btrfs_fs_info *info = root->fs_info; in update_block_group() local
2288 cache = btrfs_lookup_block_group(info, bytenr); in update_block_group()
2484 struct btrfs_fs_info *info = extent_root->fs_info; in finish_current_insert() local
2500 mutex_lock(&info->extent_ins_mutex); in finish_current_insert()
2502 ret = find_first_extent_bit(&info->extent_ins, search, &start, in finish_current_insert()
2514 ret = try_lock_extent(&info->extent_ins, start, end, GFP_NOFS); in finish_current_insert()
2520 mutex_unlock(&info->extent_ins_mutex); in finish_current_insert()
2522 mutex_lock(&info->extent_ins_mutex); in finish_current_insert()
2527 ret = get_state_private(&info->extent_ins, start, &priv); in finish_current_insert()
2553 clear_extent_bits(&info->extent_ins, extent_op->bytenr, in finish_current_insert()
2558 unlock_extent(&info->extent_ins, extent_op->bytenr, in finish_current_insert()
2564 mutex_unlock(&info->extent_ins_mutex); in finish_current_insert()
2600 mutex_lock(&info->extent_ins_mutex); in finish_current_insert()
2602 clear_extent_bits(&info->extent_ins, extent_op->bytenr, in finish_current_insert()
2608 unlock_extent(&info->extent_ins, extent_op->bytenr, in finish_current_insert()
2618 spin_lock(&info->delalloc_lock); in finish_current_insert()
2619 used = btrfs_super_bytes_used(&info->super_copy); in finish_current_insert()
2620 btrfs_set_super_bytes_used(&info->super_copy, in finish_current_insert()
2625 spin_unlock(&info->delalloc_lock); in finish_current_insert()
2636 mutex_unlock(&info->extent_ins_mutex); in finish_current_insert()
2717 struct btrfs_fs_info *info = root->fs_info; in __free_extent() local
2718 struct btrfs_root *extent_root = info->extent_root; in __free_extent()
2828 spin_lock(&info->delalloc_lock); in __free_extent()
2829 super_used = btrfs_super_bytes_used(&info->super_copy); in __free_extent()
2830 btrfs_set_super_bytes_used(&info->super_copy, in __free_extent()
2837 spin_unlock(&info->delalloc_lock); in __free_extent()
2874 struct btrfs_fs_info *info = extent_root->fs_info; in del_pending_extents() local
2882 mutex_lock(&info->extent_ins_mutex); in del_pending_extents()
2892 mutex_unlock(&info->extent_ins_mutex); in del_pending_extents()
2902 mutex_unlock(&info->extent_ins_mutex); in del_pending_extents()
2904 mutex_lock(&info->extent_ins_mutex); in del_pending_extents()
2924 ret = get_state_private(&info->extent_ins, start, in del_pending_extents()
2930 clear_extent_bits(&info->extent_ins, start, end, in del_pending_extents()
2958 mutex_unlock(&info->extent_ins_mutex); in del_pending_extents()
2960 mutex_lock(&info->extent_ins_mutex); in del_pending_extents()
3353 static void dump_space_info(struct btrfs_space_info *info, u64 bytes) in dump_space_info() argument
3358 (unsigned long long)(info->total_bytes - info->bytes_used - in dump_space_info()
3359 info->bytes_pinned - info->bytes_reserved), in dump_space_info()
3360 (info->full) ? "" : "not "); in dump_space_info()
3362 " may_use=%llu, used=%llu\n", info->total_bytes, in dump_space_info()
3363 info->bytes_pinned, info->bytes_delalloc, info->bytes_may_use, in dump_space_info()
3364 info->bytes_used); in dump_space_info()
3366 down_read(&info->groups_sem); in dump_space_info()
3367 list_for_each_entry(cache, &info->block_groups, list) { in dump_space_info()
3379 up_read(&info->groups_sem); in dump_space_info()
3391 struct btrfs_fs_info *info = root->fs_info; in __btrfs_reserve_extent() local
3404 (info->metadata_alloc_profile & in __btrfs_reserve_extent()
3405 info->avail_metadata_alloc_bits), 0); in __btrfs_reserve_extent()
3486 struct btrfs_fs_info *info = root->fs_info; in __btrfs_alloc_reserved_extent() local
3487 struct btrfs_root *extent_root = info->extent_root; in __btrfs_alloc_reserved_extent()
3497 spin_lock(&info->delalloc_lock); in __btrfs_alloc_reserved_extent()
3498 super_used = btrfs_super_bytes_used(&info->super_copy); in __btrfs_alloc_reserved_extent()
3499 btrfs_set_super_bytes_used(&info->super_copy, super_used + num_bytes); in __btrfs_alloc_reserved_extent()
3504 spin_unlock(&info->delalloc_lock); in __btrfs_alloc_reserved_extent()
3813 struct btrfs_extent_info *info; in cache_drop_leaf_ref() local
3831 info = ref->extents + sorted[i].slot; in cache_drop_leaf_ref()
3832 ret = __btrfs_free_extent(trans, root, info->bytenr, in cache_drop_leaf_ref()
3833 info->num_bytes, ref->bytenr, in cache_drop_leaf_ref()
3835 info->objectid, 0); in cache_drop_leaf_ref()
3842 info++; in cache_drop_leaf_ref()
6161 struct btrfs_fs_info *info = root->fs_info; in btrfs_relocate_block_group() local
6176 block_group = btrfs_lookup_block_group(info, group_start); in btrfs_relocate_block_group()
6186 reloc_inode = create_reloc_inode(info, block_group); in btrfs_relocate_block_group()
6192 btrfs_start_delalloc_inodes(info->tree_root); in btrfs_relocate_block_group()
6193 btrfs_wait_ordered_extents(info->tree_root, 0); in btrfs_relocate_block_group()
6203 trans = btrfs_start_transaction(info->tree_root, 1); in btrfs_relocate_block_group()
6204 btrfs_commit_transaction(trans, info->tree_root); in btrfs_relocate_block_group()
6207 btrfs_clean_old_snapshots(info->tree_root); in btrfs_relocate_block_group()
6208 btrfs_remove_leaf_refs(info->tree_root, (u64)-1, 1); in btrfs_relocate_block_group()
6279 reloc_inode = create_reloc_inode(info, block_group); in btrfs_relocate_block_group()
6289 trans = btrfs_start_transaction(info->tree_root, 1); in btrfs_relocate_block_group()
6290 btrfs_commit_transaction(trans, info->tree_root); in btrfs_relocate_block_group()
6341 int btrfs_free_block_groups(struct btrfs_fs_info *info) in btrfs_free_block_groups() argument
6347 spin_lock(&info->block_group_cache_lock); in btrfs_free_block_groups()
6348 while ((n = rb_last(&info->block_group_cache_tree)) != NULL) { in btrfs_free_block_groups()
6352 &info->block_group_cache_tree); in btrfs_free_block_groups()
6353 spin_unlock(&info->block_group_cache_lock); in btrfs_free_block_groups()
6363 spin_lock(&info->block_group_cache_lock); in btrfs_free_block_groups()
6365 spin_unlock(&info->block_group_cache_lock); in btrfs_free_block_groups()
6375 while(!list_empty(&info->space_info)) { in btrfs_free_block_groups()
6376 space_info = list_entry(info->space_info.next, in btrfs_free_block_groups()
6391 struct btrfs_fs_info *info = root->fs_info; in btrfs_read_block_groups() local
6397 root = info->extent_root; in btrfs_read_block_groups()
6436 ret = update_space_info(info, cache->flags, found_key.offset, in btrfs_read_block_groups()