diff options
Diffstat (limited to 'super-intel.c')
-rw-r--r-- | super-intel.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/super-intel.c b/super-intel.c index 4052aa6..40ec2fc 100644 --- a/super-intel.c +++ b/super-intel.c @@ -112,11 +112,14 @@ struct imsm_super { static char *map_state_str[] = { "normal", "uninitialized", "degraded", "failed" }; #endif -static unsigned long long mpb_sectors(struct imsm_super *mpb) +static unsigned int sector_count(__u32 bytes) { - __u32 size = __le32_to_cpu(mpb->mpb_size); + return ((bytes + (512-1)) & (~(512-1))) / 512; +} - return ((size + (512-1)) & (~(512-1))) / 512; +static unsigned int mpb_sectors(struct imsm_super *mpb) +{ + return sector_count(__le32_to_cpu(mpb->mpb_size)); } /* internal representation of IMSM metadata */ @@ -328,6 +331,7 @@ static void examine_super_imsm(struct supertype *st, char *homehost) sum = __le32_to_cpu(mpb->check_sum); printf(" Checksum : %08x %s\n", sum, gen_imsm_checksum(mpb) == sum ? "correct" : "incorrect"); + printf(" MPB Sectors : %d\n", mpb_sectors(mpb)); printf(" Disks : %d\n", mpb->num_disks); printf(" RAID Devices : %d\n", mpb->num_raid_devs); print_imsm_disk(mpb, super->disks->index); |