diff mbox series

btrfs: remove unnecessary wrapper get_alloc_profile

Message ID 20200102161457.20216-1-jth@kernel.org (mailing list archive)
State New, archived
Headers show
Series btrfs: remove unnecessary wrapper get_alloc_profile | expand

Commit Message

Johannes Thumshirn Jan. 2, 2020, 4:14 p.m. UTC
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.

Signed-off-by: Johannes Thumshirn <jth@kernel.org>
---
 fs/btrfs/block-group.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Comments

Josef Bacik Jan. 2, 2020, 4:21 p.m. UTC | #1
On 1/2/20 11:14 AM, Johannes Thumshirn wrote:
> 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.
> 
> Signed-off-by: Johannes Thumshirn <jth@kernel.org>

Reviewed-by: Josef Bacik <josef@toxicpanda.com>

Thanks,

Josef
Anand Jain Jan. 6, 2020, 10:30 a.m. UTC | #2
Reviewed-by: Anand Jain <anand.jain@oracle.com>
David Sterba Jan. 6, 2020, 2:10 p.m. UTC | #3
On Thu, Jan 02, 2020 at 05:14:57PM +0100, Johannes Thumshirn wrote:
> 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.
> 
> Signed-off-by: Johannes Thumshirn <jth@kernel.org>

Added to misc-next, thanks.
diff mbox series

Patch

diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c
index 66fa39632cde..bdd6485c3120 100644
--- a/fs/btrfs/block-group.c
+++ b/fs/btrfs/block-group.c
@@ -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);