summaryrefslogtreecommitdiff
path: root/usr/src/cmd/format
diff options
context:
space:
mode:
authorbo zhou - Sun Microsystems - Beijing China <Bo.Zhou@Sun.COM>2010-04-30 14:22:47 +0800
committerbo zhou - Sun Microsystems - Beijing China <Bo.Zhou@Sun.COM>2010-04-30 14:22:47 +0800
commit3a5b922f0684c84516905a0053650ade21556f43 (patch)
treee2e49707f8d436ec9334b7fe4a7dfc97ea25a131 /usr/src/cmd/format
parent328d222be1e6f8291e6805ec610012ec96e249ec (diff)
downloadillumos-joyent-3a5b922f0684c84516905a0053650ade21556f43.tar.gz
6947865 format is showing incorrect value for Total disk sectors available for EFI labeled disks
Diffstat (limited to 'usr/src/cmd/format')
-rw-r--r--usr/src/cmd/format/menu_partition.c31
1 files changed, 12 insertions, 19 deletions
diff --git a/usr/src/cmd/format/menu_partition.c b/usr/src/cmd/format/menu_partition.c
index df69959537..b228821beb 100644
--- a/usr/src/cmd/format/menu_partition.c
+++ b/usr/src/cmd/format/menu_partition.c
@@ -19,8 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/*
@@ -405,26 +404,20 @@ p_print()
if ((cur_parts->pinfo_name != NULL) && (cur_label == L_TYPE_SOLARIS)) {
fmt_print("Current partition table (%s):\n",
cur_parts->pinfo_name);
- fmt_print(
-"Total disk cylinders available: %d + %d (reserved cylinders)\n\n", ncyl, acyl);
- } else if ((cur_label == L_TYPE_EFI) && (cur_parts->pinfo_name !=
- NULL)) {
- fmt_print("Current partition table (%s):\n",
- cur_parts->pinfo_name);
- fmt_print(
-"Total disk sectors available: %llu + %d (reserved sectors)\n\n",
- cur_parts->etoc->efi_last_u_lba - EFI_MIN_RESV_SIZE,
- EFI_MIN_RESV_SIZE);
+ fmt_print("Total disk cylinders available: %d + %d "
+ "(reserved cylinders)\n\n", ncyl, acyl);
} else if (cur_label == L_TYPE_SOLARIS) {
fmt_print("Current partition table (unnamed):\n");
- fmt_print(
-"Total disk cylinders available: %d + %d (reserved cylinders)\n\n", ncyl, acyl);
+ fmt_print("Total disk cylinders available: %d + %d "
+ "(reserved cylinders)\n\n", ncyl, acyl);
} else if (cur_label == L_TYPE_EFI) {
- fmt_print("Current partition table (unnamed):\n");
- fmt_print(
-"Total disk sectors available: %llu + %d (reserved sectors)\n\n",
- cur_parts->etoc->efi_last_u_lba - EFI_MIN_RESV_SIZE,
- EFI_MIN_RESV_SIZE);
+ fmt_print("Current partition table (%s):\n",
+ cur_parts->pinfo_name != NULL ?
+ cur_parts->pinfo_name : "unnamed");
+ fmt_print("Total disk sectors available: %llu + %d "
+ "(reserved sectors)\n\n",
+ cur_parts->etoc->efi_last_u_lba - EFI_MIN_RESV_SIZE -
+ cur_parts->etoc->efi_first_u_lba + 1, EFI_MIN_RESV_SIZE);
}