]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Reduce max bitmap size when bitmap is in a file.
authorNeil Brown <neilb@suse.de>
Mon, 16 Oct 2006 05:26:43 +0000 (15:26 +1000)
committerNeil Brown <neilb@suse.de>
Mon, 16 Oct 2006 05:26:43 +0000 (15:26 +1000)
To ensure kernel never needs to allocate more than 1 page contiguously.

ChangeLog
bitmap.c

index e89a0dd5dba81f6f97f4a815a10d2422f121cb6c..44fd296494f86a91f7e582fc0782c7bae516aac0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,9 @@
 Changes Prior to this release
     -   Don't #include linux/blkpg.h as that isn't safe.  Just
        include the content literally.
+    -   Reduce maximum bitmap usage when working with bitmap files,
+       so that a only single-page allocations are made, even on
+       64bit hosts with 4K pages.
 
 Changes Prior to 2.5.4 release
     -   When creating devices in /dev/md/ create matching symlinks
index 768c17fc0bb480b79917490e6a4a6a77263d2994..81dc62b256de6393bc20ec1a387202dbf0b110a7 100644 (file)
--- a/bitmap.c
+++ b/bitmap.c
@@ -345,11 +345,12 @@ int CreateBitmap(char *filename, int force, char uuid[16],
        if (chunksize == UnSet) {
                /* We don't want more than 2^21 chunks, as 2^11 fill up one
                 * 4K page (2 bytes per chunk), and 2^10 address of those
-                * fill up a 4K indexing page.  2^20 might be safer...
+                * fill up a 4K indexing page.  2^20 might be safer, especially
+                * on 64bit hosts, so use that.
                 */
                chunksize = DEFAULT_BITMAP_CHUNK;
-               /* <<21 for 2^21 chunks, >>9 to convert bytes to sectors */
-               while (array_size > (chunksize << (21-9)))
+               /* <<20 for 2^20 chunks, >>9 to convert bytes to sectors */
+               while (array_size > (chunksize << (20-9)))
                        chunksize <<= 1;
        }