summaryrefslogtreecommitdiffstats
path: root/super0.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2006-12-14 17:31:00 +1100
committerNeil Brown <neilb@suse.de>2006-12-14 17:31:00 +1100
commit199171a297a87d7696b6b8c07ee520363f4603c1 (patch)
treec14892a4cca18dd1dd01539a3c39f91f28045228 /super0.c
parent90cf1dddb25f047494b943cf2dd67ebffd42ed05 (diff)
downloadmdadm-199171a297a87d7696b6b8c07ee520363f4603c1.tar.gz
mdadm-199171a297a87d7696b6b8c07ee520363f4603c1.tar.xz
mdadm-199171a297a87d7696b6b8c07ee520363f4603c1.zip
Improve allocation and use of space for bitmaps in version1 metadata
Depending on the size of the array we reserve space for up to 128K of bitmap, and we use it where possible. When hot-adding to a version 1.0 we can still only use the 3K at the end though - need a sysfs interface to improve that. If a small chunksize is requested on Create, we don't auto-enlarge the reserved space - this still needs to be fixed.
Diffstat (limited to 'super0.c')
-rw-r--r--super0.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/super0.c b/super0.c
index 600aae0..fbb7eb9 100644
--- a/super0.c
+++ b/super0.c
@@ -827,7 +827,10 @@ static __u64 avail_size0(struct supertype *st, __u64 devsize)
return MD_NEW_SIZE_SECTORS(devsize);
}
-static int add_internal_bitmap0(struct supertype *st, void *sbv, int chunk, int delay, int write_behind, unsigned long long size, int may_change, int major)
+static int add_internal_bitmap0(struct supertype *st, void *sbv, int *chunkp,
+ int delay, int write_behind,
+ unsigned long long size, int may_change,
+ int major)
{
/*
* The bitmap comes immediately after the superblock and must be 60K in size
@@ -838,6 +841,7 @@ static int add_internal_bitmap0(struct supertype *st, void *sbv, int chunk, int
unsigned long long bits;
unsigned long long max_bits = 60*1024*8;
unsigned long long min_chunk;
+ int chunk = *chunkp;
mdp_super_t *sb = sbv;
bitmap_super_t *bms = (bitmap_super_t*)(((char*)sb) + MD_SB_BYTES);
@@ -863,7 +867,7 @@ static int add_internal_bitmap0(struct supertype *st, void *sbv, int chunk, int
bms->daemon_sleep = __cpu_to_le32(delay);
bms->sync_size = __cpu_to_le64(size);
bms->write_behind = __cpu_to_le32(write_behind);
-
+ *chunkp = chunk;
return 1;
}