Lines Matching refs:temp
154 ext_part_t *temp;
159 if ((temp = calloc(1, sizeof (ext_part_t))) == NULL) {
164 (void) strncpy(temp->device_name, devstr,
165 sizeof (temp->device_name));
168 if (stat(temp->device_name, &sbuf) != 0) {
171 (void) snprintf(temp->device_name, sizeof (temp->device_name),
174 if (stat(temp->device_name, &sbuf) != 0) {
181 if (strrchr(temp->device_name, 'p') == NULL) {
182 (void) strcat(temp->device_name, "p0");
185 if (stat(temp->device_name, &sbuf) != 0) {
200 temp->ld_head = NULL;
201 temp->sorted_ld_head = NULL;
203 if ((temp->dev_fd = open(temp->device_name, O_RDWR, 0666)) < 0) {
208 if ((temp->mtable = parttab) == NULL) {
209 if ((rval = fdisk_init_master_part_table(temp)) !=
223 temp->op_flag = opflag;
225 if ((rval = fdisk_init_disk_geom(temp)) != FDISK_SUCCESS) {
229 *epp = temp;
242 free(temp);
360 logical_drive_t *temp = fdisk_get_ld_head(epp);
365 for (pno = 5; temp != NULL; temp = temp->next, pno++) {
366 if (fdisk_is_solaris_part(LE_8(temp->parts[0].systid))) {
367 part_start = temp->abs_secnum + temp->logdrive_offset;
368 if ((temp->parts[0].systid == SUNIXOS) &&
375 *numsec = temp->numsect;
386 logical_drive_t *temp = fdisk_get_ld_head(epp);
393 for (pno = 5; (pno < pnum) && (temp != NULL); temp = temp->next, pno++)
396 if (temp == NULL) {
400 *sysid = LE_8(temp->parts[0].systid);
401 *begsec = temp->abs_secnum + temp->logdrive_offset;
402 *numsec = temp->numsect;
412 logical_drive_t *temp;
414 if ((temp = calloc(1, sizeof (logical_drive_t))) == NULL) {
417 temp->next = NULL;
418 return (temp);
427 logical_drive_t *temp;
429 for (temp = epp->ld_head; temp != NULL; ) {
430 temp = epp->ld_head -> next;
432 epp->ld_head = temp;
444 logical_drive_t *temp;
467 for (temp = epp->sorted_ld_head; temp != NULL; temp =
468 temp->sorted_next) {
469 if (temp->abs_secnum == *first_free_sec) {
470 *first_free_sec = temp->abs_secnum +
471 temp->logdrive_offset + temp->numsect;
504 logical_drive_t *temp;
508 for (temp = epp->sorted_ld_head; temp != NULL;
509 temp = temp->sorted_next) {
510 if (temp->abs_secnum > begsec) {
511 last_free_sec = temp->abs_secnum - 1;
569 logical_drive_t *temp;
572 for (temp = epp->ld_head; temp != NULL; temp = temp->next) {
573 firstsec = temp->abs_secnum;
574 lastsec = firstsec + temp->logdrive_offset + temp->numsect - 1;
625 logical_drive_t *temp, *ep_ptr;
665 temp = fdisk_alloc_ld_node();
666 temp->abs_secnum = secnum;
667 temp->logdrive_offset =
669 temp ->numsect = LE_32(ext_fdp->numsect);
672 if (temp->logdrive_offset >
675 temp->abs_secnum +=
676 temp->logdrive_offset;
677 temp->logdrive_offset = 0;
680 temp->begcyl =
681 FDISK_SECT_TO_CYL(epp, temp->abs_secnum);
682 temp->endcyl = FDISK_SECT_TO_CYL(epp,
683 temp->abs_secnum +
684 temp->logdrive_offset +
685 temp->numsect - 1);
691 temp->abs_secnum, temp->logdrive_offset,
692 temp->numsect)) {
694 free(temp);
698 temp->parts[0] = *ext_fdp;
700 temp->parts[1] = *ext_fdp;
703 epp->ld_head = temp;
704 epp->sorted_ld_head = temp;
705 ep_ptr = temp;
708 ep_ptr->next = temp;
709 ep_ptr = temp;
711 temp);
719 temp->modified = FDISK_MINOR_WRITE;
822 logical_drive_t *temp;
843 for (temp = epp->ld_head; temp != NULL; temp = temp->next) {
844 if ((begcyl >= temp->begcyl) &&
845 (begcyl <= temp->endcyl)) {
857 logical_drive_t *temp;
861 for (temp = epp->ld_head; i < pno; temp = temp->next, i++)
864 temp->parts[0].systid = LE_8(partid);
865 temp->modified = FDISK_MAJOR_WRITE;
889 logical_drive_t *temp, *pre, *cur;
892 temp = fdisk_alloc_ld_node();
893 temp->abs_secnum = begsec;
894 temp->logdrive_offset = MAX_LOGDRIVE_OFFSET;
895 temp->numsect = endsec - begsec + 1 - MAX_LOGDRIVE_OFFSET;
896 temp->begcyl = FDISK_SECT_TO_CYL(epp, begsec);
897 temp->endcyl = FDISK_SECT_TO_CYL(epp, endsec);
898 temp->modified = FDISK_MAJOR_WRITE;
900 part = &temp->parts[0];
904 part->numsect = LE_32(temp->numsect);
912 temp->numsect = endsec - begsec + 1;
913 part->numsect = LE_32(temp->numsect);
915 temp->logdrive_offset = 0;
917 temp->abs_secnum = epp->ext_beg_sec;
918 temp->logdrive_offset = LE_32(part->relsect);
922 epp->ld_head = temp;
923 epp->sorted_ld_head = temp;
928 if (temp->abs_secnum == epp->ext_beg_sec) {
930 temp->logdrive_offset--;
931 temp->abs_secnum++;
940 part->relsect = LE_32(temp->abs_secnum - epp->ext_beg_sec);
941 part->numsect = LE_32(temp->numsect + temp->logdrive_offset);
945 pre->next = temp;
948 fdisk_ext_place_in_sorted_list(epp, temp);
1184 logical_drive_t *temp;
1210 for (temp = epp->ld_head; temp != NULL; temp = temp->next) {
1211 if (temp == epp->ld_head) {
1214 abs_secnum = temp->abs_secnum;
1216 if (temp->modified == FDISK_MINOR_WRITE) {
1218 temp->parts, abs_secnum);
1222 temp->modified = 0;
1223 } else if (temp->modified == FDISK_MAJOR_WRITE) {
1269 for (temp = epp->ld_head, ld_count = 0; temp != NULL;
1270 temp = temp->next, ld_count++) {
1274 abs_secnum = temp->abs_secnum;
1276 if (temp->modified) {
1278 temp->parts, abs_secnum);
1292 if ((!wflag) && (temp->modified ==