diff options
author | Neil Brown <neilb@suse.de> | 2005-10-11 04:44:44 +0000 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2005-10-11 04:44:44 +0000 |
commit | dcec9ee54779586f287f5db98ab1be3f0f02dd3f (patch) | |
tree | 053ff57337183f7b975433ad45f74a8cb245cdf9 /bitmap.c | |
parent | 5a6d7f456ad67779321d8aa81203f70bcc56a0a5 (diff) | |
download | mdadm-dcec9ee54779586f287f5db98ab1be3f0f02dd3f.tar.gz |
Create version-4 bitmaps if kernel supports it.
Version-3 bitmaps are host-endian. Version-4 are little-endian
and so more portable.
Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'bitmap.c')
-rw-r--r-- | bitmap.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -243,7 +243,8 @@ int ExamineBitmap(char *filename, int brief, struct supertype *st) fprintf(stderr, Name ": invalid bitmap magic 0x%x, the bitmap file appears to be corrupted\n", sb->magic); } printf(" Version : %d\n", sb->version); - if (sb->version != BITMAP_MAJOR) { + if (sb->version < BITMAP_MAJOR_LO || + sb->version > BITMAP_MAJOR_HI) { fprintf(stderr, Name ": unknown bitmap version %d, either the bitmap file is corrupted or you need to upgrade your tools\n", sb->version); goto free_info; } @@ -287,7 +288,8 @@ free_info: int CreateBitmap(char *filename, int force, char uuid[16], unsigned long chunksize, unsigned long daemon_sleep, unsigned long write_behind, - unsigned long long array_size /* sectors */) + unsigned long long array_size /* sectors */, + int major) { /* * Create a bitmap file with a superblock and (optionally) a full bitmap @@ -313,7 +315,7 @@ int CreateBitmap(char *filename, int force, char uuid[16], memset(&sb, 0, sizeof(sb)); sb.magic = BITMAP_MAGIC; - sb.version = BITMAP_MAJOR; + sb.version = major; if (uuid != NULL) memcpy(sb.uuid, uuid, 16); sb.chunksize = chunksize; |