diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-04 14:56:22 (GMT) |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-04 14:56:22 (GMT) |
commit | 08542241cf710d1b7c28c63b2213be4b7b1b3362 (patch) | |
tree | acafbf265de573f020cdaeb3539d0bdb3c71dec6 | |
parent | f4622045455faaac958ca35a0cf313f3d6c14d8b (diff) | |
parent | b16b1b6cd052acbacc0a15f934bca9b354534d48 (diff) | |
download | linux-08542241cf710d1b7c28c63b2213be4b7b1b3362.tar.xz |
Merge tag 'md-3.4-fixes' of git://neil.brown.name/md
Pull one small fix for md/bitmaps from NeilBrown:
"This fixes a regression that was introduced in the merge window."
* tag 'md-3.4-fixes' of git://neil.brown.name/md:
md/bitmap: fix calculation of 'chunks' - missing shift.
-rw-r--r-- | drivers/md/bitmap.c | 3 | ||||
-rw-r--r-- | drivers/md/bitmap.h | 3 |
2 files changed, 1 insertions, 5 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index 97e73e5..17e2b47 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c @@ -1727,8 +1727,7 @@ int bitmap_create(struct mddev *mddev) bitmap->chunkshift = (ffz(~mddev->bitmap_info.chunksize) - BITMAP_BLOCK_SHIFT); - /* now that chunksize and chunkshift are set, we can use these macros */ - chunks = (blocks + bitmap->chunkshift - 1) >> + chunks = (blocks + (1 << bitmap->chunkshift) - 1) >> bitmap->chunkshift; pages = (chunks + PAGE_COUNTER_RATIO - 1) / PAGE_COUNTER_RATIO; diff --git a/drivers/md/bitmap.h b/drivers/md/bitmap.h index 55ca5ae..b44b0aba 100644 --- a/drivers/md/bitmap.h +++ b/drivers/md/bitmap.h @@ -101,9 +101,6 @@ typedef __u16 bitmap_counter_t; #define BITMAP_BLOCK_SHIFT 9 -/* how many blocks per chunk? (this is variable) */ -#define CHUNK_BLOCK_RATIO(bitmap) ((bitmap)->mddev->bitmap_info.chunksize >> BITMAP_BLOCK_SHIFT) - #endif /* |