aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2018-09-21 08:26:34 -0400
committerDavid Sterba <dsterba@suse.com>2018-10-15 11:23:35 -0400
commit818255feece6e2a432328020d78c8a81a153ce65 (patch)
treef2d95505a0f9ec09399cd98fa788e3b48bdbb0de
parent0110a4c43451533de1ea1bbdc57b5d452f9d8b25 (diff)
btrfs: use common helper instead of open coding a bit test
The helper does the same math and we take care about the special case when flags is 0 too. Reviewed-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--fs/btrfs/volumes.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 909c578506ee..26eb388db343 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -3691,7 +3691,7 @@ static int alloc_profile_is_valid(u64 flags, int extended)
3691 return !extended; /* "0" is valid for usual profiles */ 3691 return !extended; /* "0" is valid for usual profiles */
3692 3692
3693 /* true if exactly one bit set */ 3693 /* true if exactly one bit set */
3694 return (flags & (flags - 1)) == 0; 3694 return is_power_of_2(flags);
3695} 3695}
3696 3696
3697static inline int balance_need_close(struct btrfs_fs_info *fs_info) 3697static inline int balance_need_close(struct btrfs_fs_info *fs_info)