diff options
author | Neil Brown <neilb@suse.de> | 2006-12-14 07:31:00 +0100 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2006-12-14 07:31:00 +0100 |
commit | 199171a297a87d7696b6b8c07ee520363f4603c1 (patch) | |
tree | c14892a4cca18dd1dd01539a3c39f91f28045228 /super0.c | |
parent | Actually support --syslog (diff) | |
download | 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.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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; } |