X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fmd%2Fdm-snap.c;h=cee16fadd9ee70379449ce995ac4043d1ff86e5f;hb=1212663fba7c5e003e05d24f043d5ed57eb18b24;hp=98a633f3d6b002673e17e797b34c30903a2bfa39;hpb=c4ec20717313daafba59225f812db89595952b83;p=linux-2.6 diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c index 98a633f3d6..cee16fadd9 100644 --- a/drivers/md/dm-snap.c +++ b/drivers/md/dm-snap.c @@ -17,6 +17,7 @@ #include #include #include +#include #include "dm-snap.h" #include "dm-bio-list.h" @@ -415,7 +416,7 @@ static int set_chunk_size(struct dm_snapshot *s, const char *chunk_size_arg, chunk_size = round_up(chunk_size, PAGE_SIZE >> 9); /* Check chunk_size is a power of 2 */ - if (chunk_size & (chunk_size - 1)) { + if (!is_power_of_2(chunk_size)) { *error = "Chunk size is not a power of 2"; return -EINVAL; }