diff options
Diffstat (limited to 'drivers/md/dm-snap.c')
-rw-r--r-- | drivers/md/dm-snap.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c index 98a633f3d6b0..cee16fadd9ee 100644 --- a/drivers/md/dm-snap.c +++ b/drivers/md/dm-snap.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/module.h> | 17 | #include <linux/module.h> |
18 | #include <linux/slab.h> | 18 | #include <linux/slab.h> |
19 | #include <linux/vmalloc.h> | 19 | #include <linux/vmalloc.h> |
20 | #include <linux/log2.h> | ||
20 | 21 | ||
21 | #include "dm-snap.h" | 22 | #include "dm-snap.h" |
22 | #include "dm-bio-list.h" | 23 | #include "dm-bio-list.h" |
@@ -415,7 +416,7 @@ static int set_chunk_size(struct dm_snapshot *s, const char *chunk_size_arg, | |||
415 | chunk_size = round_up(chunk_size, PAGE_SIZE >> 9); | 416 | chunk_size = round_up(chunk_size, PAGE_SIZE >> 9); |
416 | 417 | ||
417 | /* Check chunk_size is a power of 2 */ | 418 | /* Check chunk_size is a power of 2 */ |
418 | if (chunk_size & (chunk_size - 1)) { | 419 | if (!is_power_of_2(chunk_size)) { |
419 | *error = "Chunk size is not a power of 2"; | 420 | *error = "Chunk size is not a power of 2"; |
420 | return -EINVAL; | 421 | return -EINVAL; |
421 | } | 422 | } |