From: Josef Bacik <josef@toxicpanda.com>
Date: Thu, 20 Jun 2019 15:37:58 -0400
Subject: btrfs: temporarily export btrfs_get_restripe_target
Git-commit: 8484764e8587dc3defa9579b795e3f7bbf9789c5
Patch-mainline: v5.4-rc1
References: bsc#1162831
This gets used by a few different logical chunks of the block group
code, export it while we move things around.
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Acked-by: Nikolay Borisov <nborisov@suse.com>
---
fs/btrfs/block-group.h | 1 +
fs/btrfs/extent-tree.c | 8 ++++----
2 files changed, 5 insertions(+), 4 deletions(-)
--- a/fs/btrfs/block-group.h
+++ b/fs/btrfs/block-group.h
@@ -197,5 +197,6 @@ static inline int btrfs_block_group_cach
}
int __btrfs_inc_block_group_ro(struct btrfs_block_group_cache *cache, int force);
+u64 btrfs_get_restripe_target(struct btrfs_fs_info *fs_info, u64 flags);
#endif /* BTRFS_BLOCK_GROUP_H */
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -3049,7 +3049,7 @@ int btrfs_extent_readonly(struct btrfs_f
*
* should be called with balance_lock held
*/
-static u64 get_restripe_target(struct btrfs_fs_info *fs_info, u64 flags)
+u64 btrfs_get_restripe_target(struct btrfs_fs_info *fs_info, u64 flags)
{
struct btrfs_balance_control *bctl = fs_info->balance_ctl;
u64 target = 0;
@@ -3090,7 +3090,7 @@ static u64 btrfs_reduce_alloc_profile(st
* try to reduce to the target profile
*/
spin_lock(&fs_info->balance_lock);
- target = get_restripe_target(fs_info, flags);
+ target = btrfs_get_restripe_target(fs_info, flags);
if (target) {
/* pick target profile only if it's already available */
if ((flags & target) & BTRFS_EXTENDED_PROFILE_MASK) {
@@ -6539,7 +6539,7 @@ static u64 update_block_group_flags(stru
* if restripe for this chunk_type is on pick target profile and
* return, otherwise do the usual balance
*/
- stripped = get_restripe_target(fs_info, flags);
+ stripped = btrfs_get_restripe_target(fs_info, flags);
if (stripped)
return extended_to_chunk(stripped);
@@ -6842,7 +6842,7 @@ int btrfs_can_relocate(struct btrfs_fs_i
* 3: raid0
* 4: single
*/
- target = get_restripe_target(fs_info, block_group->flags);
+ target = btrfs_get_restripe_target(fs_info, block_group->flags);
if (target) {
index = btrfs_bg_flags_to_raid_index(extended_to_chunk(target));
} else {