diff options
| author | Josef Bacik <josef@toxicpanda.com> | 2019-06-20 15:37:54 -0400 |
|---|---|---|
| committer | David Sterba <dsterba@suse.com> | 2019-09-09 08:59:08 -0400 |
| commit | 3b2a78f21d5c53ff34b8e03cba4f904c91d4b3a2 (patch) | |
| tree | 51cbbf39ec899933cec45903c9783220f98828c5 /fs/btrfs/extent-tree.c | |
| parent | 9f21246d8c7efb940b96098cb556bfe86205fbed (diff) | |
btrfs: temporarily export inc_block_group_ro
This is used in a few logical parts of the block group code, temporarily
export it so we can move things in pieces.
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
| -rw-r--r-- | fs/btrfs/extent-tree.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 4b352325ff7f..08bd67169590 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
| @@ -6697,7 +6697,7 @@ static u64 update_block_group_flags(struct btrfs_fs_info *fs_info, u64 flags) | |||
| 6697 | * data in this block group. That check should be done by relocation routine, | 6697 | * data in this block group. That check should be done by relocation routine, |
| 6698 | * not this function. | 6698 | * not this function. |
| 6699 | */ | 6699 | */ |
| 6700 | static int inc_block_group_ro(struct btrfs_block_group_cache *cache, int force) | 6700 | int __btrfs_inc_block_group_ro(struct btrfs_block_group_cache *cache, int force) |
| 6701 | { | 6701 | { |
| 6702 | struct btrfs_space_info *sinfo = cache->space_info; | 6702 | struct btrfs_space_info *sinfo = cache->space_info; |
| 6703 | u64 num_bytes; | 6703 | u64 num_bytes; |
| @@ -6807,14 +6807,14 @@ again: | |||
| 6807 | goto out; | 6807 | goto out; |
| 6808 | } | 6808 | } |
| 6809 | 6809 | ||
| 6810 | ret = inc_block_group_ro(cache, 0); | 6810 | ret = __btrfs_inc_block_group_ro(cache, 0); |
| 6811 | if (!ret) | 6811 | if (!ret) |
| 6812 | goto out; | 6812 | goto out; |
| 6813 | alloc_flags = get_alloc_profile(fs_info, cache->space_info->flags); | 6813 | alloc_flags = get_alloc_profile(fs_info, cache->space_info->flags); |
| 6814 | ret = btrfs_chunk_alloc(trans, alloc_flags, CHUNK_ALLOC_FORCE); | 6814 | ret = btrfs_chunk_alloc(trans, alloc_flags, CHUNK_ALLOC_FORCE); |
| 6815 | if (ret < 0) | 6815 | if (ret < 0) |
| 6816 | goto out; | 6816 | goto out; |
| 6817 | ret = inc_block_group_ro(cache, 0); | 6817 | ret = __btrfs_inc_block_group_ro(cache, 0); |
| 6818 | out: | 6818 | out: |
| 6819 | if (cache->flags & BTRFS_BLOCK_GROUP_SYSTEM) { | 6819 | if (cache->flags & BTRFS_BLOCK_GROUP_SYSTEM) { |
| 6820 | alloc_flags = update_block_group_flags(fs_info, cache->flags); | 6820 | alloc_flags = update_block_group_flags(fs_info, cache->flags); |
| @@ -7347,7 +7347,7 @@ int btrfs_read_block_groups(struct btrfs_fs_info *info) | |||
| 7347 | 7347 | ||
| 7348 | set_avail_alloc_bits(info, cache->flags); | 7348 | set_avail_alloc_bits(info, cache->flags); |
| 7349 | if (btrfs_chunk_readonly(info, cache->key.objectid)) { | 7349 | if (btrfs_chunk_readonly(info, cache->key.objectid)) { |
| 7350 | inc_block_group_ro(cache, 1); | 7350 | __btrfs_inc_block_group_ro(cache, 1); |
| 7351 | } else if (btrfs_block_group_used(&cache->item) == 0) { | 7351 | } else if (btrfs_block_group_used(&cache->item) == 0) { |
| 7352 | ASSERT(list_empty(&cache->bg_list)); | 7352 | ASSERT(list_empty(&cache->bg_list)); |
| 7353 | btrfs_mark_bg_unused(cache); | 7353 | btrfs_mark_bg_unused(cache); |
| @@ -7368,11 +7368,11 @@ int btrfs_read_block_groups(struct btrfs_fs_info *info) | |||
| 7368 | list_for_each_entry(cache, | 7368 | list_for_each_entry(cache, |
| 7369 | &space_info->block_groups[BTRFS_RAID_RAID0], | 7369 | &space_info->block_groups[BTRFS_RAID_RAID0], |
| 7370 | list) | 7370 | list) |
| 7371 | inc_block_group_ro(cache, 1); | 7371 | __btrfs_inc_block_group_ro(cache, 1); |
| 7372 | list_for_each_entry(cache, | 7372 | list_for_each_entry(cache, |
| 7373 | &space_info->block_groups[BTRFS_RAID_SINGLE], | 7373 | &space_info->block_groups[BTRFS_RAID_SINGLE], |
| 7374 | list) | 7374 | list) |
| 7375 | inc_block_group_ro(cache, 1); | 7375 | __btrfs_inc_block_group_ro(cache, 1); |
| 7376 | } | 7376 | } |
| 7377 | 7377 | ||
| 7378 | btrfs_init_global_block_rsv(info); | 7378 | btrfs_init_global_block_rsv(info); |
| @@ -7911,7 +7911,7 @@ void btrfs_delete_unused_bgs(struct btrfs_fs_info *fs_info) | |||
| 7911 | spin_unlock(&block_group->lock); | 7911 | spin_unlock(&block_group->lock); |
| 7912 | 7912 | ||
| 7913 | /* We don't want to force the issue, only flip if it's ok. */ | 7913 | /* We don't want to force the issue, only flip if it's ok. */ |
| 7914 | ret = inc_block_group_ro(block_group, 0); | 7914 | ret = __btrfs_inc_block_group_ro(block_group, 0); |
| 7915 | up_write(&space_info->groups_sem); | 7915 | up_write(&space_info->groups_sem); |
| 7916 | if (ret < 0) { | 7916 | if (ret < 0) { |
| 7917 | ret = 0; | 7917 | ret = 0; |
