Skip to contentSkip to conversation

btrfs: remove unnecessary wrapper get_alloc_profile

PATCH In review Johannes Thumshirn 4 participants 4 messages Jan 2, 2020 – Jan 6, 2020 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs: remove unnecessary wrapper get_alloc_profile

btrfs_get_alloc_profile() is a simple wrapper over get_alloc_profile(). The only difference is btrfs_get_alloc_profile() is visible to other functions in btrfs while get_alloc_profile() is static and thus only visible to functions in block-group.c.

Let's just fold get_alloc_profile() into btrfs_get_alloc_profile() to get rid of the unnecessary second function.

---
 fs/btrfs/block-group.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
fs/btrfs/block-group.c +1 -6
index 66fa39632cde..bdd6485c3120 100644
@@ -95,7 +95,7 @@ static u64 btrfs_reduce_alloc_profile(struct btrfs_fs_info *fs_info, u64 flags)
 	return extended_to_chunk(flags | allowed);
 }
 
-static u64 get_alloc_profile(struct btrfs_fs_info *fs_info, u64 orig_flags)
+u64 btrfs_get_alloc_profile(struct btrfs_fs_info *fs_info, u64 orig_flags)
 {
 	unsigned seq;
 	u64 flags;
@@ -115,11 +115,6 @@ static u64 get_alloc_profile(struct btrfs_fs_info *fs_info, u64 orig_flags)
 	return btrfs_reduce_alloc_profile(fs_info, flags);
 }
 
-u64 btrfs_get_alloc_profile(struct btrfs_fs_info *fs_info, u64 orig_flags)
-{
-	return get_alloc_profile(fs_info, orig_flags);
-}
-
 void btrfs_get_block_group(struct btrfs_block_group *cache)
 {
 	atomic_inc(&cache->count);
Signature · 1 line
2.16.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Johannes Thumshirn

btrfs_get_alloc_profile() is a simple wrapper over get_alloc_profile(). The only difference is btrfs_get_alloc_profile() is visible to other functions in btrfs while get_alloc_profile() is static and thus only visible to functions in block-group.c.

Let's just fold get_alloc_profile() into btrfs_get_alloc_profile() to get rid of the unnecessary second function.

Thanks,

Josef

#3 lore raw
In reply to Johannes Thumshirn
Quoted 9 lines · Johannes Thumshirn

btrfs_get_alloc_profile() is a simple wrapper over get_alloc_profile(). The only difference is btrfs_get_alloc_profile() is visible to other functions in btrfs while get_alloc_profile() is static and thus only visible to functions in block-group.c.

Let's just fold get_alloc_profile() into btrfs_get_alloc_profile() to get rid of the unnecessary second function.

Added to misc-next, thanks.