]> err.no Git - linux-2.6/commitdiff
[PATCH] dm mirror log: bitset_size fix
authorAlasdair G Kergon <agk@redhat.com>
Mon, 26 Jun 2006 07:27:29 +0000 (00:27 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 26 Jun 2006 16:58:35 +0000 (09:58 -0700)
Fix the 'sizeof' in the region log bitmap size calculation: it's uint32_t, not
unsigned long - this breaks on some archs.

Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/md/dm-log.c

index f52a78fc82bbd3a4d0c1e64972c6c2000745d596..33d80721667cdb37b371f7e030e6548b2f03ec27 100644 (file)
@@ -295,10 +295,10 @@ static int create_log_context(struct dirty_log *log, struct dm_target *ti,
         * Work out how many "unsigned long"s we need to hold the bitset.
         */
        bitset_size = dm_round_up(region_count,
-                                 sizeof(unsigned long) << BYTE_SHIFT);
+                                 sizeof(*lc->clean_bits) << BYTE_SHIFT);
        bitset_size >>= BYTE_SHIFT;
 
-       lc->bitset_uint32_count = bitset_size / 4;
+       lc->bitset_uint32_count = bitset_size / sizeof(*lc->clean_bits);
 
        /*
         * Disk log?