]>
Commit | Line | Data |
---|---|---|
2cb7cef9 BS |
1 | From 1f59390339f263c0fe7908fbe54466dbf3a64b58 Mon Sep 17 00:00:00 2001 |
2 | From: NeilBrown <neilb@suse.de> | |
3 | Date: Mon, 20 Apr 2009 11:50:24 +1000 | |
4 | Subject: [PATCH] md: support bitmaps on RAID10 arrays larger then 2 terabytes | |
5 | ||
6 | .. and other arrays with components larger than 2 terabytes. | |
7 | ||
8 | We use a "long" rather than a "sector_t" in part of the bitmap | |
9 | size calculations, which is sad. | |
10 | ||
11 | Reported-by: "Mario 'BitKoenig' Holbe" <Mario.Holbe@TU-Ilmenau.DE> | |
12 | Signed-off-by: NeilBrown <neilb@suse.de> | |
13 | --- | |
14 | drivers/md/bitmap.c | 6 +++--- | |
15 | 1 file changed, 3 insertions(+), 3 deletions(-) | |
16 | ||
17 | --- a/drivers/md/bitmap.c | |
18 | +++ b/drivers/md/bitmap.c | |
19 | @@ -1587,7 +1587,7 @@ void bitmap_destroy(mddev_t *mddev) | |
20 | int bitmap_create(mddev_t *mddev) | |
21 | { | |
22 | struct bitmap *bitmap; | |
23 | - unsigned long blocks = mddev->resync_max_sectors; | |
24 | + sector_t blocks = mddev->resync_max_sectors; | |
25 | unsigned long chunks; | |
26 | unsigned long pages; | |
27 | struct file *file = mddev->bitmap_file; | |
28 | @@ -1629,8 +1629,8 @@ int bitmap_create(mddev_t *mddev) | |
29 | bitmap->chunkshift = ffz(~bitmap->chunksize); | |
30 | ||
31 | /* now that chunksize and chunkshift are set, we can use these macros */ | |
32 | - chunks = (blocks + CHUNK_BLOCK_RATIO(bitmap) - 1) / | |
33 | - CHUNK_BLOCK_RATIO(bitmap); | |
34 | + chunks = (blocks + CHUNK_BLOCK_RATIO(bitmap) - 1) >> | |
35 | + CHUNK_BLOCK_SHIFT(bitmap); | |
36 | pages = (chunks + PAGE_COUNTER_RATIO - 1) / PAGE_COUNTER_RATIO; | |
37 | ||
38 | BUG_ON(!pages); |