Lines Matching refs:space_info

340 	struct btrfs_space_info *space_info = bg->space_info;  in btrfs_wait_block_group_reservations()  local
357 down_write(&space_info->groups_sem); in btrfs_wait_block_group_reservations()
358 up_write(&space_info->groups_sem); in btrfs_wait_block_group_reservations()
701 spin_lock(&block_group->space_info->lock); in caching_thread()
704 block_group->space_info->bytes_used += bytes_used >> 1; in caching_thread()
706 spin_unlock(&block_group->space_info->lock); in caching_thread()
813 struct list_head *head = &fs_info->space_info; in clear_incompat_bg_bits()
962 down_write(&block_group->space_info->groups_sem); in btrfs_remove_block_group()
968 if (list_empty(&block_group->space_info->block_groups[index])) { in btrfs_remove_block_group()
969 kobj = block_group->space_info->block_group_kobjs[index]; in btrfs_remove_block_group()
970 block_group->space_info->block_group_kobjs[index] = NULL; in btrfs_remove_block_group()
973 up_write(&block_group->space_info->groups_sem); in btrfs_remove_block_group()
1014 spin_lock(&block_group->space_info->lock); in btrfs_remove_block_group()
1018 WARN_ON(block_group->space_info->total_bytes in btrfs_remove_block_group()
1020 WARN_ON(block_group->space_info->bytes_readonly in btrfs_remove_block_group()
1022 WARN_ON(block_group->space_info->bytes_zone_unusable in btrfs_remove_block_group()
1024 WARN_ON(block_group->space_info->disk_total in btrfs_remove_block_group()
1027 block_group->space_info->total_bytes -= block_group->length; in btrfs_remove_block_group()
1028 block_group->space_info->bytes_readonly -= in btrfs_remove_block_group()
1030 block_group->space_info->bytes_zone_unusable -= in btrfs_remove_block_group()
1032 block_group->space_info->disk_total -= block_group->length * factor; in btrfs_remove_block_group()
1034 spin_unlock(&block_group->space_info->lock); in btrfs_remove_block_group()
1161 struct btrfs_space_info *sinfo = cache->space_info; in inc_block_group_ro()
1226 btrfs_dump_space_info(cache->fs_info, cache->space_info, 0, 0); in inc_block_group_ro()
1283 struct btrfs_space_info *space_info; in btrfs_delete_unused_bgs() local
1307 space_info = block_group->space_info; in btrfs_delete_unused_bgs()
1309 if (ret || btrfs_mixed_space_info(space_info)) { in btrfs_delete_unused_bgs()
1318 down_write(&space_info->groups_sem); in btrfs_delete_unused_bgs()
1328 up_write(&space_info->groups_sem); in btrfs_delete_unused_bgs()
1347 up_write(&space_info->groups_sem); in btrfs_delete_unused_bgs()
1354 up_write(&space_info->groups_sem); in btrfs_delete_unused_bgs()
1399 spin_lock(&space_info->lock); in btrfs_delete_unused_bgs()
1402 btrfs_space_info_update_bytes_pinned(fs_info, space_info, in btrfs_delete_unused_bgs()
1404 space_info->bytes_readonly += block_group->pinned; in btrfs_delete_unused_bgs()
1408 spin_unlock(&space_info->lock); in btrfs_delete_unused_bgs()
1510 struct btrfs_space_info *space_info; in btrfs_reclaim_bgs_work() local
1544 space_info = bg->space_info; in btrfs_reclaim_bgs_work()
1548 down_write(&space_info->groups_sem); in btrfs_reclaim_bgs_work()
1559 up_write(&space_info->groups_sem); in btrfs_reclaim_bgs_work()
1566 up_write(&space_info->groups_sem); in btrfs_reclaim_bgs_work()
1578 up_write(&space_info->groups_sem); in btrfs_reclaim_bgs_work()
1881 struct btrfs_space_info *space_info = cache->space_info; in link_block_group() local
1884 down_write(&space_info->groups_sem); in link_block_group()
1885 list_add_tail(&cache->list, &space_info->block_groups[index]); in link_block_group()
1886 up_write(&space_info->groups_sem); in link_block_group()
1991 struct btrfs_space_info *space_info; in read_one_block_group() local
2085 cache->zone_unusable, &space_info); in read_one_block_group()
2087 cache->space_info = space_info; in read_one_block_group()
2113 struct btrfs_space_info *space_info; in fill_dummy_bgs() local
2155 0, 0, &space_info); in fill_dummy_bgs()
2156 bg->space_info = space_info; in fill_dummy_bgs()
2171 struct btrfs_space_info *space_info; in btrfs_read_block_groups() local
2220 list_for_each_entry(space_info, &info->space_info, list) { in btrfs_read_block_groups()
2224 if (list_empty(&space_info->block_groups[i])) in btrfs_read_block_groups()
2226 cache = list_first_entry(&space_info->block_groups[i], in btrfs_read_block_groups()
2232 if (!(btrfs_get_alloc_profile(info, space_info->flags) & in btrfs_read_block_groups()
2243 &space_info->block_groups[BTRFS_RAID_RAID0], in btrfs_read_block_groups()
2247 &space_info->block_groups[BTRFS_RAID_SINGLE], in btrfs_read_block_groups()
2431 if (block_group->space_info->block_group_kobjs[index] == NULL) in btrfs_create_pending_block_groups()
2502 cache->space_info = btrfs_find_space_info(fs_info, cache->flags); in btrfs_make_block_group()
2503 ASSERT(cache->space_info); in btrfs_make_block_group()
2519 &cache->space_info); in btrfs_make_block_group()
2601 alloc_flags = btrfs_get_alloc_profile(fs_info, cache->space_info->flags); in btrfs_inc_block_group_ro()
2624 struct btrfs_space_info *sinfo = cache->space_info; in btrfs_dec_block_group_ro()
3225 spin_lock(&cache->space_info->lock); in btrfs_update_block_group()
3238 cache->space_info->bytes_reserved -= num_bytes; in btrfs_update_block_group()
3239 cache->space_info->bytes_used += num_bytes; in btrfs_update_block_group()
3240 cache->space_info->disk_used += num_bytes * factor; in btrfs_update_block_group()
3242 spin_unlock(&cache->space_info->lock); in btrfs_update_block_group()
3248 cache->space_info, num_bytes); in btrfs_update_block_group()
3249 cache->space_info->bytes_used -= num_bytes; in btrfs_update_block_group()
3250 cache->space_info->disk_used -= num_bytes * factor; in btrfs_update_block_group()
3252 spin_unlock(&cache->space_info->lock); in btrfs_update_block_group()
3304 struct btrfs_space_info *space_info = cache->space_info; in btrfs_add_reserved_bytes() local
3307 spin_lock(&space_info->lock); in btrfs_add_reserved_bytes()
3313 space_info->bytes_reserved += num_bytes; in btrfs_add_reserved_bytes()
3315 space_info->flags, num_bytes, 1); in btrfs_add_reserved_bytes()
3317 space_info, -ram_bytes); in btrfs_add_reserved_bytes()
3326 btrfs_try_granting_tickets(cache->fs_info, space_info); in btrfs_add_reserved_bytes()
3329 spin_unlock(&space_info->lock); in btrfs_add_reserved_bytes()
3347 struct btrfs_space_info *space_info = cache->space_info; in btrfs_free_reserved_bytes() local
3349 spin_lock(&space_info->lock); in btrfs_free_reserved_bytes()
3352 space_info->bytes_readonly += num_bytes; in btrfs_free_reserved_bytes()
3354 space_info->bytes_reserved -= num_bytes; in btrfs_free_reserved_bytes()
3355 space_info->max_extent_size = 0; in btrfs_free_reserved_bytes()
3361 btrfs_try_granting_tickets(cache->fs_info, space_info); in btrfs_free_reserved_bytes()
3362 spin_unlock(&space_info->lock); in btrfs_free_reserved_bytes()
3367 struct list_head *head = &info->space_info; in force_metadata_allocation()
3610 struct btrfs_space_info *space_info; in btrfs_chunk_alloc() local
3642 space_info = btrfs_find_space_info(fs_info, flags); in btrfs_chunk_alloc()
3643 ASSERT(space_info); in btrfs_chunk_alloc()
3646 spin_lock(&space_info->lock); in btrfs_chunk_alloc()
3647 if (force < space_info->force_alloc) in btrfs_chunk_alloc()
3648 force = space_info->force_alloc; in btrfs_chunk_alloc()
3649 should_alloc = should_alloc_chunk(fs_info, space_info, force); in btrfs_chunk_alloc()
3650 if (space_info->full) { in btrfs_chunk_alloc()
3656 spin_unlock(&space_info->lock); in btrfs_chunk_alloc()
3659 spin_unlock(&space_info->lock); in btrfs_chunk_alloc()
3661 } else if (space_info->chunk_alloc) { in btrfs_chunk_alloc()
3669 spin_unlock(&space_info->lock); in btrfs_chunk_alloc()
3674 space_info->chunk_alloc = 1; in btrfs_chunk_alloc()
3676 spin_unlock(&space_info->lock); in btrfs_chunk_alloc()
3689 if (btrfs_mixed_space_info(space_info)) in btrfs_chunk_alloc()
3707 spin_lock(&space_info->lock); in btrfs_chunk_alloc()
3710 space_info->full = 1; in btrfs_chunk_alloc()
3715 space_info->max_extent_size = 0; in btrfs_chunk_alloc()
3718 space_info->force_alloc = CHUNK_ALLOC_NO_FORCE; in btrfs_chunk_alloc()
3720 space_info->chunk_alloc = 0; in btrfs_chunk_alloc()
3721 spin_unlock(&space_info->lock); in btrfs_chunk_alloc()
3893 struct btrfs_space_info *space_info; in btrfs_free_block_groups() local
3945 down_write(&block_group->space_info->groups_sem); in btrfs_free_block_groups()
3947 up_write(&block_group->space_info->groups_sem); in btrfs_free_block_groups()
3972 while (!list_empty(&info->space_info)) { in btrfs_free_block_groups()
3973 space_info = list_entry(info->space_info.next, in btrfs_free_block_groups()
3981 if (WARN_ON(space_info->bytes_pinned > 0 || in btrfs_free_block_groups()
3982 space_info->bytes_reserved > 0 || in btrfs_free_block_groups()
3983 space_info->bytes_may_use > 0)) in btrfs_free_block_groups()
3984 btrfs_dump_space_info(info, space_info, 0, 0); in btrfs_free_block_groups()
3985 WARN_ON(space_info->reclaim_size > 0); in btrfs_free_block_groups()
3986 list_del(&space_info->list); in btrfs_free_block_groups()
3987 btrfs_sysfs_remove_space_info(space_info); in btrfs_free_block_groups()