]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fdisk: don't call update_units() in label probes if not necessary
authorPetr Uzel <petr.uzel@suse.cz>
Thu, 12 Jul 2012 09:47:18 +0000 (11:47 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 16 Jul 2012 16:09:22 +0000 (18:09 +0200)
update_units() is called in _probe_labels before the label probes are
started, so we don't need to call it again in probers, unless it messes
around with geometry, which currently only check_sun_label() does (so
keep the call to update_units() in this one).

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
fdisks/fdiskaixlabel.c
fdisks/fdiskmaclabel.c
fdisks/fdisksgilabel.c

index 474a177493c12e9eccfa68442235653e656a7fec..f908abcb8913b5cc88e01dd2f77949a1253ba58a 100644 (file)
@@ -57,7 +57,6 @@ static int check_aix_label(struct fdisk_context *cxt)
        return 0;
     }
     other_endian = (aixlabel->magic == AIX_LABEL_MAGIC_SWAPPED);
-    update_units(cxt);
     disklabel = AIX_LABEL;
     partitions= 1016;
     volumes = 15;
index 1b826609d40ceddb95411cd047f384367d7c2604..cbdf5926f8130540d3e548e648f6af9008ac0e2e 100644 (file)
@@ -72,7 +72,6 @@ check_mac_label(struct fdisk_context *cxt)
 
 IS_MAC:
     other_endian = (maclabel->magic == MAC_LABEL_MAGIC_SWAPPED); // =?
-    update_units(cxt);
     disklabel = MAC_LABEL;
     partitions= 1016; // =?
     volumes = 15;      // =?
index 32dae78b0c48c09b5c20aa5450f2080771289631..c0b346ac0b84893df1f63b31f7bae86a4c33debf 100644 (file)
@@ -151,7 +151,6 @@ check_sgi_label(struct fdisk_context *cxt) {
                fprintf(stderr,
                        _("Detected sgi disklabel with wrong checksum.\n"));
        }
-       update_units(cxt);
        disklabel = SGI_LABEL;
        partitions= 16;
        volumes = 15;