aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/bitmap.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2009-04-19 21:50:24 -0400
committerNeilBrown <neilb@suse.de>2009-04-19 21:50:24 -0400
commit1f59390339f263c0fe7908fbe54466dbf3a64b58 (patch)
tree334f287c819c1876f29cd5833222eacd910e0ada /drivers/md/bitmap.c
parentc03f6a19699fce4389888a45db8245969311d868 (diff)
md: support bitmaps on RAID10 arrays larger then 2 terabytes
.. and other arrays with components larger than 2 terabytes. We use a "long" rather than a "sector_t" in part of the bitmap size calculations, which is sad. Reported-by: "Mario 'BitKoenig' Holbe" <Mario.Holbe@TU-Ilmenau.DE> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/bitmap.c')
-rw-r--r--drivers/md/bitmap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index e4510c976b34..1fb91edc7de2 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -1590,7 +1590,7 @@ void bitmap_destroy(mddev_t *mddev)
1590int bitmap_create(mddev_t *mddev) 1590int bitmap_create(mddev_t *mddev)
1591{ 1591{
1592 struct bitmap *bitmap; 1592 struct bitmap *bitmap;
1593 unsigned long blocks = mddev->resync_max_sectors; 1593 sector_t blocks = mddev->resync_max_sectors;
1594 unsigned long chunks; 1594 unsigned long chunks;
1595 unsigned long pages; 1595 unsigned long pages;
1596 struct file *file = mddev->bitmap_file; 1596 struct file *file = mddev->bitmap_file;
@@ -1632,8 +1632,8 @@ int bitmap_create(mddev_t *mddev)
1632 bitmap->chunkshift = ffz(~bitmap->chunksize); 1632 bitmap->chunkshift = ffz(~bitmap->chunksize);
1633 1633
1634 /* now that chunksize and chunkshift are set, we can use these macros */ 1634 /* now that chunksize and chunkshift are set, we can use these macros */
1635 chunks = (blocks + CHUNK_BLOCK_RATIO(bitmap) - 1) / 1635 chunks = (blocks + CHUNK_BLOCK_RATIO(bitmap) - 1) >>
1636 CHUNK_BLOCK_RATIO(bitmap); 1636 CHUNK_BLOCK_SHIFT(bitmap);
1637 pages = (chunks + PAGE_COUNTER_RATIO - 1) / PAGE_COUNTER_RATIO; 1637 pages = (chunks + PAGE_COUNTER_RATIO - 1) / PAGE_COUNTER_RATIO;
1638 1638
1639 BUG_ON(!pages); 1639 BUG_ON(!pages);