Lines Matching refs:i
136 setfreelist(int i, unsigned int f, unsigned int l) in setfreelist() argument
138 freelist[i].first = f; in setfreelist()
139 freelist[i].last = l; in setfreelist()
145 int i; in add2freelist() local
146 for (i = 0; i < 17; i++) in add2freelist()
147 if (freelist[i].last == 0) in add2freelist()
149 setfreelist(i, f, l); in add2freelist()
155 int i; in clearfreelist() local
157 for (i = 0; i < 17; i++) in clearfreelist()
158 setfreelist(i, 0, 0); in clearfreelist()
164 int i; in isinfreelist() local
166 for (i = 0; i < 17; i++) in isinfreelist()
167 if (freelist[i].first <= b && freelist[i].last >= b) in isinfreelist()
168 return freelist[i].last; in isinfreelist()
215 int i = 0; in two_s_complement_32bit_sum() local
219 for (i = 0; i < size; i++) in two_s_complement_32bit_sum()
220 sum -= SGI_SSWAP32(base[i]); in two_s_complement_32bit_sum()
258 sgi_get_start_sector(int i) in sgi_get_start_sector() argument
260 return SGI_SSWAP32(sgilabel->partitions[i].start_sector); in sgi_get_start_sector()
264 sgi_get_num_sectors(int i) in sgi_get_num_sectors() argument
266 return SGI_SSWAP32(sgilabel->partitions[i].num_sectors); in sgi_get_num_sectors()
270 sgi_get_sysid(int i) in sgi_get_sysid() argument
272 return SGI_SSWAP32(sgilabel->partitions[i].id); in sgi_get_sysid()
290 int i, w, wd; in sgi_list_table() local
321 for (i = 0; i < g_partitions; i++) { in sgi_list_table()
322 if (sgi_get_num_sectors(i) || SGI_DEBUG) { in sgi_list_table()
323 uint32_t start = sgi_get_start_sector(i); in sgi_list_table()
324 uint32_t len = sgi_get_num_sectors(i); in sgi_list_table()
328 /* fdisk part number */ i+1, in sgi_list_table()
330 /* flags */ (sgi_get_swappartition() == i) ? "swap" : in sgi_list_table()
331 /* flags */ (sgi_get_bootpartition() == i) ? "boot" : " ", in sgi_list_table()
335 /* type id */ sgi_get_sysid(i), in sgi_list_table()
336 /* type name */ partition_type(sgi_get_sysid(i))); in sgi_list_table()
342 for (i = 0; i < sgi_volumes; i++) { in sgi_list_table()
343 if (sgilabel->directory[i].vol_file_size) { in sgi_list_table()
344 uint32_t start = SGI_SSWAP32(sgilabel->directory[i].vol_file_start); in sgi_list_table()
345 uint32_t len = SGI_SSWAP32(sgilabel->directory[i].vol_file_size); in sgi_list_table()
346 unsigned char *name = sgilabel->directory[i].vol_file_name; in sgi_list_table()
349 i, (char*)name, (unsigned int) start, (unsigned int) len); in sgi_list_table()
355 sgi_set_bootpartition(int i) in sgi_set_bootpartition() argument
357 sgilabel->boot_part = SGI_SSWAP16(((short)i)); in sgi_set_bootpartition()
367 sgi_set_swappartition(int i) in sgi_set_swappartition() argument
369 sgilabel->swap_part = SGI_SSWAP16(((short)i)); in sgi_set_swappartition()
407 int i = 0; in sgi_set_bootfile() local
410 while (i < 16) { in sgi_set_bootfile()
411 if ((aFile[i] != '\n') /* in principle caught again by next line */ in sgi_set_bootfile()
412 && (strlen(aFile) > i)) in sgi_set_bootfile()
413 sgilabel->boot_file[i] = aFile[i]; in sgi_set_bootfile()
415 sgilabel->boot_file[i] = 0; in sgi_set_bootfile()
416 i++; in sgi_set_bootfile()
463 unsigned int i = *x; in compare_start() local
465 unsigned int a = sgi_get_start_sector(i); in compare_start()
467 unsigned int c = sgi_get_num_sectors(i); in compare_start()
481 int entire = 0, i = 0; in verify_sgi() local
487 for (i = 0; i < 16; i++) { in verify_sgi()
488 if (sgi_get_num_sectors(i) != 0) { in verify_sgi()
489 Index[sortcount++] = i; in verify_sgi()
490 if (sgi_get_sysid(i) == SGI_ENTIRE_DISK) { in verify_sgi()
527 for (i = 1, start = 0; i < sortcount; i++) { in verify_sgi()
530 if ((sgi_get_start_sector(Index[i]) % cylsize) != 0) { in verify_sgi()
534 Index[i]+1); in verify_sgi()
536 if (sgi_get_num_sectors(Index[i]) % cylsize != 0) { in verify_sgi()
540 Index[i]+1); in verify_sgi()
543 if (sgi_get_sysid(Index[i]) == SGI_ENTIRE_DISK) continue; in verify_sgi()
544 if (start > sgi_get_start_sector(Index[i])) { in verify_sgi()
547 Index[i-1]+1, Index[i]+1, in verify_sgi()
548 start - sgi_get_start_sector(Index[i])); in verify_sgi()
552 if (start < sgi_get_start_sector(Index[i])) { in verify_sgi()
555 sgi_get_start_sector(Index[i]) - start, in verify_sgi()
556 start, sgi_get_start_sector(Index[i])-1); in verify_sgi()
557 gap += sgi_get_start_sector(Index[i]) - start; in verify_sgi()
558 add2freelist(start, sgi_get_start_sector(Index[i])); in verify_sgi()
560 start = sgi_get_start_sector(Index[i]) in verify_sgi()
561 + sgi_get_num_sectors(Index[i]); in verify_sgi()
564 printf("%2u:%12u\t%12u\t%12u\n", Index[i], in verify_sgi()
565 sgi_get_start_sector(Index[i]), in verify_sgi()
566 sgi_get_num_sectors(Index[i]), in verify_sgi()
567 sgi_get_sysid(Index[i])); in verify_sgi()
611 sgi_change_sysid(int i, int sys) in sgi_change_sysid() argument
613 if (sgi_get_num_sectors(i) == 0) { /* caught already before, ... */ in sgi_change_sysid()
618 && (sgi_get_start_sector(i) < 1) in sgi_change_sysid()
629 sgilabel->partitions[i].id = SGI_SSWAP32(sys); in sgi_change_sysid()
636 int i; in sgi_entire() local
638 for (i = 0; i < 16; i++) in sgi_entire()
639 if (sgi_get_sysid(i) == SGI_VOLUME) in sgi_entire()
640 return i; in sgi_entire()
645 sgi_set_partition(int i, unsigned int start, unsigned int length, int sys) in sgi_set_partition() argument
647 sgilabel->partitions[i].id = SGI_SSWAP32(sys); in sgi_set_partition()
648 sgilabel->partitions[i].num_sectors = SGI_SSWAP32(length); in sgi_set_partition()
649 sgilabel->partitions[i].start_sector = SGI_SSWAP32(start); in sgi_set_partition()
650 set_changed(i); in sgi_set_partition()
690 sgi_delete_partition(int i) in sgi_delete_partition() argument
692 sgi_set_partition(i, 0, 0, 0); in sgi_delete_partition()
772 int i = 0; in create_sgilabel() local
798 for (i = 0; i < 4; i++) { in create_sgilabel()
799 old[i].sysid = 0; in create_sgilabel()
801 if (get_part_table(i)->sys_ind) { in create_sgilabel()
802 old[i].sysid = get_part_table(i)->sys_ind; in create_sgilabel()
803 old[i].start = get_start_sect(get_part_table(i)); in create_sgilabel()
804 old[i].nsect = get_nr_sects(get_part_table(i)); in create_sgilabel()
805 printf("Trying to keep parameters of partition %u\n", i); in create_sgilabel()
808 old[i].sysid, old[i].start, old[i].nsect); in create_sgilabel()
856 for (i = 0; i < 4; i++) { in create_sgilabel()
857 if (old[i].sysid) { in create_sgilabel()
858 sgi_set_partition(i, old[i].start, old[i].nsect, old[i].sysid); in create_sgilabel()