projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0110a4c
)
btrfs: use common helper instead of open coding a bit test
author
David Sterba
<dsterba@suse.com>
Fri, 21 Sep 2018 12:26:34 +0000
(14:26 +0200)
committer
David Sterba
<dsterba@suse.com>
Mon, 15 Oct 2018 15:23:35 +0000
(17:23 +0200)
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>
fs/btrfs/volumes.c
patch
|
blob
|
history
diff --git
a/fs/btrfs/volumes.c
b/fs/btrfs/volumes.c
index 909c578506eec42671b7de96327cb2121b2be47e..26eb388db343588183b5f06eb782daa32d91bef3 100644
(file)
--- a/
fs/btrfs/volumes.c
+++ b/
fs/btrfs/volumes.c
@@
-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)