From ddf7850f2b775c2148f76cd7e839b8a6e667de8e Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 16 Sep 2009 03:03:13 +0200 Subject: fdisk: add a warning and truncate disks with >= 2^32 sectors As a result, for sectors we can use uint32_t instead of long long, and on 32 bits it has drastic effects: function old new delta get_geometry 619 646 +27 set_sun_partition 148 150 +2 get_partition 134 135 +1 xbsd_write_bootstrap 382 381 -1 xbsd_readlabel 247 246 -1 bsd_select 1674 1672 -2 sun_other_endian 4 1 -3 scsi_disk 4 1 -3 floppy 4 1 -3 fdisk_main 3735 3732 -3 read_maybe_empty 43 37 -6 create_doslabel 111 104 -7 read_line 97 88 -9 add_logical 117 107 -10 write_table 599 588 -11 new_partition 1684 1670 -14 list_disk_geometry 229 215 -14 wrong_p_order 130 110 -20 xselect 3142 3114 -28 seek_sector 71 40 -31 get_boot 1576 1533 -43 fill_bounds 174 128 -46 delete_partition 603 551 -52 list_table 1401 1232 -169 set_partition 459 286 -173 verify 1840 1495 -345 add_partition 2486 1270 -1216 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/24 up/down: 30/-2210) Total: -2180 bytes text data bss dec hex filename 848812 460 7116 856388 d1144 busybox_old 846620 460 7108 854188 d08ac busybox_unstripped Signed-off-by: Denys Vlasenko --- util-linux/fdisk_aix.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'util-linux/fdisk_aix.c') diff --git a/util-linux/fdisk_aix.c b/util-linux/fdisk_aix.c index 2c0d2a6ac..2a0ab1744 100644 --- a/util-linux/fdisk_aix.c +++ b/util-linux/fdisk_aix.c @@ -54,8 +54,9 @@ aix_info(void) static int check_aix_label(void) { - if (aixlabel->magic != AIX_LABEL_MAGIC && - aixlabel->magic != AIX_LABEL_MAGIC_SWAPPED) { + if (aixlabel->magic != AIX_LABEL_MAGIC + && aixlabel->magic != AIX_LABEL_MAGIC_SWAPPED + ) { current_label_type = 0; aix_other_endian = 0; return 0; -- cgit v1.2.3