summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2009-04-12 00:58:28 -0700
committerDan Williams <dan.j.williams@intel.com>2009-04-12 00:58:28 -0700
commit979d38be50e84b70e0809249a6b05864049fb97d (patch)
tree0ffdcada6e56c4ea14bc51ae308540b5e2ce0023
parentda9b4a62af80edbbcc96196ab5d887308516ba70 (diff)
downloadmdadm-979d38be50e84b70e0809249a6b05864049fb97d.tar.gz
mdadm-979d38be50e84b70e0809249a6b05864049fb97d.tar.xz
mdadm-979d38be50e84b70e0809249a6b05864049fb97d.zip
imsm: round down array size at Create
Store the 1MB rounded down size of the array at create time. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
-rw-r--r--super-intel.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/super-intel.c b/super-intel.c
index b41ab3b..3415da4 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -53,6 +53,7 @@
#define MPB_SECTOR_CNT 418
#define IMSM_RESERVED_SECTORS 4096
+#define SECT_PER_MB_SHIFT 11
/* Disk configuration info. */
#define IMSM_MAX_DEVICES 255
@@ -2377,6 +2378,9 @@ static int init_super_imsm_volume(struct supertype *st, mdu_array_info_t *info,
array_blocks = calc_array_size(info->level, info->raid_disks,
info->layout, info->chunk_size,
info->size*2);
+ /* round array size down to closest MB */
+ array_blocks = (array_blocks >> SECT_PER_MB_SHIFT) << SECT_PER_MB_SHIFT;
+
dev->size_low = __cpu_to_le32((__u32) array_blocks);
dev->size_high = __cpu_to_le32((__u32) (array_blocks >> 32));
dev->status = __cpu_to_le32(0);