summaryrefslogtreecommitdiffstats
path: root/super0.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2006-05-15 03:57:53 +0000
committerNeil Brown <neilb@suse.de>2006-05-15 03:57:53 +0000
commit8686f3ed069671e5cbf8660cfd73c92b066563d0 (patch)
tree32b6ea0570799ac73035d827dc53b60d87027e01 /super0.c
parentb578481ca382959da894ebdd91c5e5f45d50374d (diff)
downloadmdadm-8686f3ed069671e5cbf8660cfd73c92b066563d0.tar.gz
mdadm-8686f3ed069671e5cbf8660cfd73c92b066563d0.tar.xz
mdadm-8686f3ed069671e5cbf8660cfd73c92b066563d0.zip
Fix problem with sector/KB size confuision for bitmap sizing.
Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'super0.c')
-rw-r--r--super0.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/super0.c b/super0.c
index 8bded15..9c313ca 100644
--- a/super0.c
+++ b/super0.c
@@ -739,7 +739,7 @@ static int add_internal_bitmap0(struct supertype *st, void *sbv, int chunk, int
* The bitmap comes immediately after the superblock and must be 60K in size
* at most. The default size is between 30K and 60K
*
- * size is in K, chunk is in bytes !!!
+ * size is in sectors, chunk is in bytes !!!
*/
unsigned long long bits;
unsigned long long max_bits = 60*1024*8;
@@ -749,7 +749,7 @@ static int add_internal_bitmap0(struct supertype *st, void *sbv, int chunk, int
min_chunk = 4096; /* sub-page chunks don't work yet.. */
- bits = (size * 512)/ min_chunk +1;
+ bits = (size * 512) / min_chunk + 1;
while (bits > max_bits) {
min_chunk *= 2;
bits = (bits+1)/2;
@@ -770,8 +770,6 @@ static int add_internal_bitmap0(struct supertype *st, void *sbv, int chunk, int
bms->sync_size = __cpu_to_le64(size);
bms->write_behind = __cpu_to_le32(write_behind);
-
-
return 1;
}