summaryrefslogtreecommitdiffstats
path: root/bitmap.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2006-10-16 15:26:43 +1000
committerNeil Brown <neilb@suse.de>2006-10-16 15:26:43 +1000
commitb39827de21032f5bda931242f232ec9c3cb7da98 (patch)
tree34ac5f630691562826561ce9ada12d1f3de16ebc /bitmap.c
parent97a6748ce2fc70f35b599bd16b76d16a1e48bc0d (diff)
downloadmdadm-b39827de21032f5bda931242f232ec9c3cb7da98.tar.gz
mdadm-b39827de21032f5bda931242f232ec9c3cb7da98.tar.xz
mdadm-b39827de21032f5bda931242f232ec9c3cb7da98.zip
Reduce max bitmap size when bitmap is in a file.
To ensure kernel never needs to allocate more than 1 page contiguously.
Diffstat (limited to 'bitmap.c')
-rw-r--r--bitmap.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/bitmap.c b/bitmap.c
index 768c17f..81dc62b 100644
--- 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;
}