diff options
author | Neil Brown <neilb@suse.de> | 2002-03-15 06:21:36 +0100 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2002-03-15 06:21:36 +0100 |
commit | 56eb10c0b6e8f21540af444c8a28aa9e8f138ce6 (patch) | |
tree | 3b791ce573cca8c746f318411cb63d8c677678a1 /Detail.c | |
parent | mdadm-0.7 (diff) | |
download | mdadm-56eb10c0b6e8f21540af444c8a28aa9e8f138ce6.tar.xz mdadm-56eb10c0b6e8f21540af444c8a28aa9e8f138ce6.zip |
mdadm-0.7.1mdadm-0.7.1
Diffstat (limited to 'Detail.c')
-rw-r--r-- | Detail.c | 18 |
1 files changed, 11 insertions, 7 deletions
@@ -81,20 +81,24 @@ int Detail(char *dev, int brief) if (brief) printf("ARRAY %s level=%s disks=%d", dev, c?c:"-unknown-",array.raid_disks ); else { - int array_size; - if (ioctl(fd, BLKGETSIZE, &array_size)) - array_size = 0; - else array_size>>= 1; + long array_size; + long long larray_size; + if (ioctl(fd, BLKGETSIZE64, &larray_size)==0) + ; + else if (ioctl(fd, BLKGETSIZE, &array_size)==0) + larray_size = array_size<<9; + else larray_size = 0; + printf("%s:\n", dev); printf(" Version : %02d.%02d.%02d\n", array.major_version, array.minor_version, array.patch_version); atime = array.ctime; printf(" Creation Time : %.24s\n", ctime(&atime)); printf(" Raid Level : %s\n", c?c:"-unknown-"); - if (array_size) - printf(" Array Size : %d%s\n", array_size, human_size(array_size)); + if (larray_size) + printf(" Array Size : %ld%s\n", (long)(larray_size>>10), human_size(larray_size)); if (array.level >= 1) - printf(" Device Size : %d%s\n", array.size, human_size(array.size)); + printf(" Device Size : %d%s\n", array.size, human_size((long long)array.size<<10)); printf(" Raid Disks : %d\n", array.raid_disks); printf(" Total Disks : %d\n", array.nr_disks); printf("Preferred Minor : %d\n", array.md_minor); |