static void set_partition(struct fdisk_context *cxt, int i, int doext, sector_t start, sector_t stop, int sysid) { struct partition *p; sector_t offset; if (doext) { p = ptes[i].ext_pointer; offset = extended_offset; } else { p = ptes[i].part_table; offset = ptes[i].offset; } p->boot_ind = 0; p->sys_ind = sysid; set_start_sect(p, start - offset); set_nr_sects(p, stop - start + 1); if (!doext) print_partition_size(cxt, i + 1, start, stop, sysid); if (dos_compatible_flag && (start/(cxt->geom.sectors*cxt->geom.heads) > 1023)) start = cxt->geom.heads*cxt->geom.sectors*1024 - 1; set_hsc(p->head, p->sector, p->cyl, start); if (dos_compatible_flag && (stop/(cxt->geom.sectors*cxt->geom.heads) > 1023)) stop = cxt->geom.heads*cxt->geom.sectors*1024 - 1; set_hsc(p->end_head, p->end_sector, p->end_cyl, stop); ptes[i].changed = 1; }
static void sgi_set_partition(int i, unsigned int start, unsigned int length, int sys) { sgilabel->partitions[i].id = SSWAP32(sys); sgilabel->partitions[i].num_sectors = SSWAP32(length); sgilabel->partitions[i].start_sector = SSWAP32(start); set_changed(i); if (sgi_gaps() < 0) /* rebuild freelist */ printf(_("Partition overlap on the disk.\n")); if (length) print_partition_size(i + 1, start, start + length, sys); }
static int sgi_set_partition(struct fdisk_context *cxt, int i, unsigned int start, unsigned int length, int sys) { sgilabel->partitions[i].id = SSWAP32(sys); sgilabel->partitions[i].num_sectors = SSWAP32(length); sgilabel->partitions[i].start_sector = SSWAP32(start); set_changed(i); if (sgi_gaps(cxt) < 0) /* rebuild freelist */ printf(_("Partition overlap on the disk.\n")); if (length) print_partition_size(cxt, i + 1, start, start + length, sys); return 0; }