summaryrefslogtreecommitdiffstats
path: root/fdisks/fdiskdoslabel.c
diff options
context:
space:
mode:
authorKarel Zak2013-06-25 16:57:56 +0200
committerKarel Zak2013-09-16 16:47:04 +0200
commit4f79f8872b1b116d36a929cc61f57dda4391a654 (patch)
tree3bd1a621f619b87753bc6f84899af2d9dca2f410 /fdisks/fdiskdoslabel.c
parentfdisk: remove nowarn global variable (diff)
downloadkernel-qcow2-util-linux-4f79f8872b1b116d36a929cc61f57dda4391a654.tar.gz
kernel-qcow2-util-linux-4f79f8872b1b116d36a929cc61f57dda4391a654.tar.xz
kernel-qcow2-util-linux-4f79f8872b1b116d36a929cc61f57dda4391a654.zip
fdisk: cleanup warning messages
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'fdisks/fdiskdoslabel.c')
-rw-r--r--fdisks/fdiskdoslabel.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/fdisks/fdiskdoslabel.c b/fdisks/fdiskdoslabel.c
index 934312b6c..7b1391786 100644
--- a/fdisks/fdiskdoslabel.c
+++ b/fdisks/fdiskdoslabel.c
@@ -145,24 +145,6 @@ static int is_cleared_partition(struct dos_partition *p)
dos_partition_get_start(p) || dos_partition_get_size(p));
}
-static void warn_alignment(struct fdisk_context *cxt)
-{
- if (fdisk_context_listonly(cxt))
- return;
-
- if (cxt->sector_size != cxt->phy_sector_size)
- fdisk_info(cxt, _(
-"The device presents a logical sector size that is smaller than "
-"the physical sector size. Aligning to a physical sector (or optimal "
-"I/O) size boundary is recommended, or performance may be impacted."));
-
- if (is_dos_compatible(cxt))
- fdisk_warnx(cxt, _("DOS-compatible mode is deprecated."));
-
- if (fdisk_context_use_cylinders(cxt))
- fdisk_warnx(cxt, _("Cylinders as display units are deprecated."));
-
-}
static int get_partition_unused_primary(struct fdisk_context *cxt)
{
@@ -266,10 +248,28 @@ static void dos_init(struct fdisk_context *cxt)
pe->changed = 0;
}
- warn_geometry(cxt);
- warn_alignment(cxt);
+ if (fdisk_context_listonly(cxt))
+ return;
+ /*
+ * Various warnings...
+ */
+ if (fdisk_missing_geometry(cxt))
+ fdisk_warnx(cxt, _("You can set geometry from the extra functions menu."));
+
+ if (is_dos_compatible(cxt)) {
+ fdisk_warnx(cxt, _("DOS-compatible mode is deprecated."));
+
+ if (cxt->sector_size != cxt->phy_sector_size)
+ fdisk_info(cxt, _(
+ "The device presents a logical sector size that is smaller than "
+ "the physical sector size. Aligning to a physical sector (or optimal "
+ "I/O) size boundary is recommended, or performance may be impacted."));
+ }
+
+ if (fdisk_context_use_cylinders(cxt))
+ fdisk_warnx(cxt, _("Cylinders as display units are deprecated."));
- if (cxt->total_sectors > UINT_MAX && !fdisk_context_listonly(cxt)) {
+ if (cxt->total_sectors > UINT_MAX) {
unsigned long long bytes = cxt->total_sectors * cxt->sector_size;
int giga = bytes / 1000000000;
int hectogiga = (giga + 50) / 100;