[PATCH 07/15] dm mirror log: bitset_size fix

From: Alasdair G Kergon
Date: Wed Jun 21 2006 - 15:36:13 EST


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@xxxxxxxxxx>

Index: linux-2.6.17/drivers/md/dm-log.c
===================================================================
--- linux-2.6.17.orig/drivers/md/dm-log.c 2006-06-21 17:17:55.000000000 +0100
+++ linux-2.6.17/drivers/md/dm-log.c 2006-06-21 17:17:56.000000000 +0100
@@ -295,10 +295,10 @@ static int create_log_context(struct dir
* 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?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/