提交 818255fe 编写于 作者: D David Sterba

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: NNikolay Borisov <nborisov@suse.com>
Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 0110a4c4
......@@ -3691,7 +3691,7 @@ static int alloc_profile_is_valid(u64 flags, int extended)
return !extended; /* "0" is valid for usual profiles */
/* true if exactly one bit set */
return (flags & (flags - 1)) == 0;
return is_power_of_2(flags);
}
static inline int balance_need_close(struct btrfs_fs_info *fs_info)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册