aboutsummaryrefslogtreecommitdiff
path: root/util-linux/fdisk_sgi.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-12-16 17:22:33 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-12-16 17:22:33 +0000
commitf77f369ce89549ae3b0b70bfbac4e9c242ec5298 (patch)
treeb7b9979a4dc949a9bd7f8db90c48ba5491eb1844 /util-linux/fdisk_sgi.c
parentc794c51a1aa23d2edcff8e1ab4edf96194d3208c (diff)
downloadbusybox-w32-f77f369ce89549ae3b0b70bfbac4e9c242ec5298.tar.gz
busybox-w32-f77f369ce89549ae3b0b70bfbac4e9c242ec5298.tar.bz2
busybox-w32-f77f369ce89549ae3b0b70bfbac4e9c242ec5298.zip
fdisk: reduce global data/bss usage. 8k data+bss build is achievable soon ;)
(add/remove: 0/13 grow/shrink: 6/19 up/down: 74/-492) Total: -418 bytes text data bss dec hex filename 778330 860 7408 786598 c00a6 busybox_old 777970 840 7376 786186 bff0a busybox_unstripped
Diffstat (limited to 'util-linux/fdisk_sgi.c')
-rw-r--r--util-linux/fdisk_sgi.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/util-linux/fdisk_sgi.c b/util-linux/fdisk_sgi.c
index 25e75b06c..f0bd195a1 100644
--- a/util-linux/fdisk_sgi.c
+++ b/util-linux/fdisk_sgi.c
@@ -248,7 +248,7 @@ check_sgi_label(void)
248 } 248 }
249 update_units(); 249 update_units();
250 current_label_type = label_sgi; 250 current_label_type = label_sgi;
251 partitions = 16; 251 g_partitions = 16;
252 sgi_volumes = 15; 252 sgi_volumes = 15;
253 return 1; 253 return 1;
254} 254}
@@ -295,7 +295,7 @@ sgi_list_table(int xtra)
295 "%d extra sects/cyl, interleave %d:1\n" 295 "%d extra sects/cyl, interleave %d:1\n"
296 "%s\n" 296 "%s\n"
297 "Units = %s of %d * 512 bytes\n\n", 297 "Units = %s of %d * 512 bytes\n\n",
298 disk_device, heads, sectors, cylinders, 298 disk_device, g_heads, g_sectors, g_cylinders,
299 SGI_SSWAP16(sgiparam.pcylcount), 299 SGI_SSWAP16(sgiparam.pcylcount),
300 SGI_SSWAP16(sgiparam.sparecyl), 300 SGI_SSWAP16(sgiparam.sparecyl),
301 SGI_SSWAP16(sgiparam.ilfact), 301 SGI_SSWAP16(sgiparam.ilfact),
@@ -305,7 +305,7 @@ sgi_list_table(int xtra)
305 printf("\nDisk %s (SGI disk label): " 305 printf("\nDisk %s (SGI disk label): "
306 "%d heads, %d sectors, %d cylinders\n" 306 "%d heads, %d sectors, %d cylinders\n"
307 "Units = %s of %d * 512 bytes\n\n", 307 "Units = %s of %d * 512 bytes\n\n",
308 disk_device, heads, sectors, cylinders, 308 disk_device, g_heads, g_sectors, g_cylinders,
309 str_units(PLURAL), units_per_sector ); 309 str_units(PLURAL), units_per_sector );
310 } 310 }
311 311
@@ -317,7 +317,7 @@ sgi_list_table(int xtra)
317 printf("----- partitions -----\n" 317 printf("----- partitions -----\n"
318 "Pt# %*s Info Start End Sectors Id System\n", 318 "Pt# %*s Info Start End Sectors Id System\n",
319 w + 2, "Device"); 319 w + 2, "Device");
320 for (i = 0; i < partitions; i++) { 320 for (i = 0; i < g_partitions; i++) {
321 if (sgi_get_num_sectors(i) || debug ) { 321 if (sgi_get_num_sectors(i) || debug ) {
322 uint32_t start = sgi_get_start_sector(i); 322 uint32_t start = sgi_get_start_sector(i);
323 uint32_t len = sgi_get_num_sectors(i); 323 uint32_t len = sgi_get_num_sectors(i);
@@ -359,7 +359,7 @@ sgi_set_bootpartition(int i)
359static unsigned int 359static unsigned int
360sgi_get_lastblock(void) 360sgi_get_lastblock(void)
361{ 361{
362 return heads * sectors * cylinders; 362 return g_heads * g_sectors * g_cylinders;
363} 363}
364 364
365static void 365static void
@@ -660,7 +660,7 @@ sgi_set_entire(void)
660{ 660{
661 int n; 661 int n;
662 662
663 for (n = 10; n < partitions; n++) { 663 for (n = 10; n < g_partitions; n++) {
664 if (!sgi_get_num_sectors(n) ) { 664 if (!sgi_get_num_sectors(n) ) {
665 sgi_set_partition(n, 0, sgi_get_lastblock(), SGI_VOLUME); 665 sgi_set_partition(n, 0, sgi_get_lastblock(), SGI_VOLUME);
666 break; 666 break;
@@ -673,7 +673,7 @@ sgi_set_volhdr(void)
673{ 673{
674 int n; 674 int n;
675 675
676 for (n = 8; n < partitions; n++) { 676 for (n = 8; n < g_partitions; n++) {
677 if (!sgi_get_num_sectors(n)) { 677 if (!sgi_get_num_sectors(n)) {
678 /* 678 /*
679 * 5 cylinders is an arbitrary value I like 679 * 5 cylinders is an arbitrary value I like
@@ -681,8 +681,8 @@ sgi_set_volhdr(void)
681 * (like sash, symmon, fx, ide) with ca. 3200 681 * (like sash, symmon, fx, ide) with ca. 3200
682 * sectors. 682 * sectors.
683 */ 683 */
684 if (heads * sectors * 5 < sgi_get_lastblock()) 684 if (g_heads * g_sectors * 5 < sgi_get_lastblock())
685 sgi_set_partition(n, 0, heads * sectors * 5, SGI_VOLHDR); 685 sgi_set_partition(n, 0, g_heads * g_sectors * 5, SGI_VOLHDR);
686 break; 686 break;
687 } 687 }
688 } 688 }
@@ -783,18 +783,18 @@ create_sgilabel(void)
783 sgi_other_endian = (BYTE_ORDER == LITTLE_ENDIAN); 783 sgi_other_endian = (BYTE_ORDER == LITTLE_ENDIAN);
784 res = ioctl(fd, BLKGETSIZE, &longsectors); 784 res = ioctl(fd, BLKGETSIZE, &longsectors);
785 if (!ioctl(fd, HDIO_GETGEO, &geometry)) { 785 if (!ioctl(fd, HDIO_GETGEO, &geometry)) {
786 heads = geometry.heads; 786 g_heads = geometry.heads;
787 sectors = geometry.sectors; 787 g_sectors = geometry.sectors;
788 if (res == 0) { 788 if (res == 0) {
789 /* the get device size ioctl was successful */ 789 /* the get device size ioctl was successful */
790 cylinders = longsectors / (heads * sectors); 790 g_cylinders = longsectors / (g_heads * g_sectors);
791 cylinders /= sec_fac; 791 g_cylinders /= sec_fac;
792 } else { 792 } else {
793 /* otherwise print error and use truncated version */ 793 /* otherwise print error and use truncated version */
794 cylinders = geometry.cylinders; 794 g_cylinders = geometry.cylinders;
795 printf( 795 printf(
796"Warning: BLKGETSIZE ioctl failed on %s. Using geometry cylinder value of %d.\n" 796"Warning: BLKGETSIZE ioctl failed on %s. Using geometry cylinder value of %d.\n"
797"This value may be truncated for devices > 33.8 GB.\n", disk_device, cylinders); 797"This value may be truncated for devices > 33.8 GB.\n", disk_device, g_cylinders);
798 } 798 }
799 } 799 }
800 for (i = 0; i < 4; i++) { 800 for (i = 0; i < 4; i++) {
@@ -851,7 +851,7 @@ create_sgilabel(void)
851 //memset( &(sgilabel->directory), 0, sizeof(struct volume_directory)*15 ); 851 //memset( &(sgilabel->directory), 0, sizeof(struct volume_directory)*15 );
852 //memset( &(sgilabel->partitions), 0, sizeof(struct sgi_partinfo)*16 ); 852 //memset( &(sgilabel->partitions), 0, sizeof(struct sgi_partinfo)*16 );
853 current_label_type = label_sgi; 853 current_label_type = label_sgi;
854 partitions = 16; 854 g_partitions = 16;
855 sgi_volumes = 15; 855 sgi_volumes = 15;
856 sgi_set_entire(); 856 sgi_set_entire();
857 sgi_set_volhdr(); 857 sgi_set_volhdr();