Lines Matching refs:i
84 set_sun_partition(int i, unsigned start, unsigned stop, int sysid) in set_sun_partition() argument
86 sunlabel->infos[i].id = sysid; in set_sun_partition()
87 sunlabel->partitions[i].start_cylinder = in set_sun_partition()
89 sunlabel->partitions[i].num_sectors = in set_sun_partition()
91 set_changed(i); in set_sun_partition()
171 int i; in sun_autoconfigure_scsi() local
212 for (i = 0; i < ARRAY_SIZE(sun_drives); i++) { in sun_autoconfigure_scsi()
213 if (*sun_drives[i].vendor && strcasecmp(sun_drives[i].vendor, vendor)) in sun_autoconfigure_scsi()
215 if (!strstr(model, sun_drives[i].model)) in sun_autoconfigure_scsi()
218 sun_drives[i].vendor, in sun_autoconfigure_scsi()
219 (*sun_drives[i].vendor) ? " " : "", in sun_autoconfigure_scsi()
220 sun_drives[i].model); in sun_autoconfigure_scsi()
221 p = sun_drives + i; in sun_autoconfigure_scsi()
245 unsigned i; in create_sunlabel() local
249 for (i = 0; i < ARRAY_SIZE(sun_drives); i++) { in create_sunlabel()
251 i + 'a', sun_drives[i].vendor, in create_sunlabel()
252 (*sun_drives[i].vendor) ? " " : "", in create_sunlabel()
253 sun_drives[i].model); in create_sunlabel()
356 toggle_sunflags(int i, unsigned char mask) in toggle_sunflags() argument
358 if (sunlabel->infos[i].flags & mask) in toggle_sunflags()
359 sunlabel->infos[i].flags &= ~mask; in toggle_sunflags()
361 sunlabel->infos[i].flags |= mask; in toggle_sunflags()
362 set_changed(i); in toggle_sunflags()
368 int i, continuous = 1; in fetch_sun() local
372 for (i = 0; i < g_partitions; i++) { in fetch_sun()
373 if (sunlabel->partitions[i].num_sectors in fetch_sun()
374 && sunlabel->infos[i].id in fetch_sun()
375 && sunlabel->infos[i].id != SUN_WHOLE_DISK) { in fetch_sun()
376 starts[i] = SUN_SSWAP32(sunlabel->partitions[i].start_cylinder) * g_heads * g_sectors; in fetch_sun()
377 lens[i] = SUN_SSWAP32(sunlabel->partitions[i].num_sectors); in fetch_sun()
379 if (starts[i] == *start) in fetch_sun()
380 *start += lens[i]; in fetch_sun()
381 else if (starts[i] + lens[i] >= *stop) in fetch_sun()
382 *stop = starts[i]; in fetch_sun()
389 starts[i] = 0; in fetch_sun()
390 lens[i] = 0; in fetch_sun()
410 int i,j,k,starto,endo; in verify_sun() local
416 for (i = 0; i < 8; i++) { in verify_sun()
417 if (k && (lens[i] % (g_heads * g_sectors))) { in verify_sun()
418 printf("Partition %u doesn't end on cylinder boundary\n", i+1); in verify_sun()
420 if (lens[i]) { in verify_sun()
421 for (j = 0; j < i; j++) in verify_sun()
423 if (starts[j] == starts[i]+lens[i]) { in verify_sun()
424 starts[j] = starts[i]; lens[j] += lens[i]; in verify_sun()
425 lens[i] = 0; in verify_sun()
426 } else if (starts[i] == starts[j]+lens[j]){ in verify_sun()
427 lens[j] += lens[i]; in verify_sun()
428 lens[i] = 0; in verify_sun()
430 if (starts[i] < starts[j]+lens[j] in verify_sun()
431 && starts[j] < starts[i]+lens[i]) { in verify_sun()
432 starto = starts[i]; in verify_sun()
435 endo = starts[i]+lens[i]; in verify_sun()
439 "sectors %u-%u\n", i+1, starto, endo); in verify_sun()
446 for (i = 0; i < 8; i++) { in verify_sun()
447 if (lens[i]) in verify_sun()
448 array[i] = i; in verify_sun()
450 array[i] = -1; in verify_sun()
461 for (i = 0; i < 7 && array[i+1] != -1; i++) { in verify_sun()
462 printf("Unused gap - sectors %u-%u\n", starts[array[i]]+lens[array[i]], starts[array[i+1]]); in verify_sun()
464 start = starts[array[i]] + lens[array[i]]; in verify_sun()
477 int i, first, last; in add_sun_partition() local
529 for (i = 0; i < g_partitions; i++) in add_sun_partition()
530 if (lens[i] && starts[i] <= first && starts[i] + lens[i] > first) in add_sun_partition()
532 if (i < g_partitions && !whole_disk) { in add_sun_partition()
543 for (i = 0; i < g_partitions; i++) { in add_sun_partition()
544 if (starts[i] > first && starts[i] < stop) in add_sun_partition()
545 stop = starts[i]; in add_sun_partition()
583 sun_delete_partition(int i) in sun_delete_partition() argument
587 if (i == 2 in sun_delete_partition()
588 && sunlabel->infos[i].id == SUN_WHOLE_DISK in sun_delete_partition()
589 && !sunlabel->partitions[i].start_cylinder in sun_delete_partition()
590 && (nsec = SUN_SSWAP32(sunlabel->partitions[i].num_sectors)) == g_heads * g_sectors * g_cylinders) in sun_delete_partition()
595 sunlabel->infos[i].id = 0; in sun_delete_partition()
596 sunlabel->partitions[i].num_sectors = 0; in sun_delete_partition()
600 sun_change_sysid(int i, int sys) in sun_change_sysid() argument
602 if (sys == LINUX_SWAP && !sunlabel->partitions[i].start_cylinder) { in sun_change_sysid()
616 sunlabel->infos[i].flags |= 0x01; in sun_change_sysid()
621 sunlabel->infos[i].flags &= ~0x01; in sun_change_sysid()
624 sunlabel->infos[i].id = sys; in sun_change_sysid()
630 int i, w; in sun_list_table() local
656 for (i = 0; i < g_partitions; i++) { in sun_list_table()
657 if (sunlabel->partitions[i].num_sectors) { in sun_list_table()
658 uint32_t start = SUN_SSWAP32(sunlabel->partitions[i].start_cylinder) * g_heads * g_sectors; in sun_list_table()
659 uint32_t len = SUN_SSWAP32(sunlabel->partitions[i].num_sectors); in sun_list_table()
661 partname(disk_device, i+1, w), /* device */ in sun_list_table()
662 (sunlabel->infos[i].flags & 0x01) ? 'u' : ' ', /* flags */ in sun_list_table()
663 (sunlabel->infos[i].flags & 0x10) ? 'r' : ' ', in sun_list_table()
667 sunlabel->infos[i].id, /* type id */ in sun_list_table()
668 partition_type(sunlabel->infos[i].id)); /* type name */ in sun_list_table()