Lines Matching defs:dk_ioc
250 efi_ioctl(int fd, int cmd, dk_efi_t *dk_ioc)
252 void *data = dk_ioc->dki_data;
255 dk_ioc->dki_data_64 = (uint64_t)(uintptr_t)data;
256 error = ioctl(fd, cmd, (void *)dk_ioc);
257 dk_ioc->dki_data = data;
263 check_label(int fd, dk_efi_t *dk_ioc)
268 if (efi_ioctl(fd, DKIOCGETEFI, dk_ioc) == -1) {
276 efi = dk_ioc->dki_data;
293 if (((len_t)LE_32(efi->efi_gpt_HeaderSize) > dk_ioc->dki_length) ||
317 dk_efi_t dk_ioc;
372 dk_ioc.dki_lba = 1;
388 if ((dk_ioc.dki_data = calloc(label_len, 1)) == NULL)
391 dk_ioc.dki_length = disk_info.dki_lbsize;
393 efi = dk_ioc.dki_data;
395 dk_ioc.dki_length = label_len;
396 if (efi_ioctl(fd, DKIOCGETEFI, &dk_ioc) == -1) {
404 } else if ((rval = check_label(fd, &dk_ioc)) == VT_EINVAL) {
407 * we just read GPT header and save it into dk_ioc.data,
420 dk_ioc.dki_lba = disk_info.dki_capacity - 2;
421 dk_ioc.dki_length = disk_info.dki_lbsize;
422 rval = check_label(fd, &dk_ioc);
428 dk_ioc.dki_lba = disk_info.dki_capacity - 1;
429 dk_ioc.dki_length = disk_info.dki_lbsize;
430 rval = check_label(fd, &dk_ioc);
447 dk_ioc.dki_lba = LE_64(efi->efi_gpt_PartitionEntryLBA);
456 * dk_ioc.dki_data, we try to get GUID partition
460 dk_ioc.dki_data = (efi_gpt_t *)((char *)dk_ioc.dki_data
463 dk_ioc.dki_length = disk_info.dki_capacity - 1 -
464 dk_ioc.dki_lba;
466 dk_ioc.dki_length = disk_info.dki_capacity - 2 -
467 dk_ioc.dki_lba;
468 dk_ioc.dki_length *= disk_info.dki_lbsize;
469 if (dk_ioc.dki_length >
470 ((len_t)label_len - sizeof (*dk_ioc.dki_data))) {
476 rval = efi_ioctl(fd, DKIOCGETEFI, &dk_ioc);
482 dk_ioc.dki_lba = LE_64(efi->efi_gpt_PartitionEntryLBA);
484 dk_ioc.dki_data = (efi_gpt_t *)((char *)dk_ioc.dki_data
486 dk_ioc.dki_length = label_len - disk_info.dki_lbsize;
487 rval = efi_ioctl(fd, DKIOCGETEFI, &dk_ioc);
500 dk_ioc.dki_lba = 1;
501 dk_ioc.dki_length = label_len;
502 rval = check_label(fd, &dk_ioc);
641 dk_efi_t dk_ioc;
655 dk_ioc.dki_lba = 0;
656 dk_ioc.dki_length = len;
658 dk_ioc.dki_data = (efi_gpt_t *)buf;
659 if (efi_ioctl(fd, DKIOCGETEFI, &dk_ioc) == -1) {
709 dk_ioc.dki_data = (efi_gpt_t *)buf;
710 dk_ioc.dki_lba = 0;
711 dk_ioc.dki_length = len;
712 if (efi_ioctl(fd, DKIOCSETEFI, &dk_ioc) == -1) {
988 dk_efi_t dk_ioc;
1059 dk_ioc.dki_lba = 1;
1061 dk_ioc.dki_length = EFI_MIN_ARRAY_SIZE + vtoc->efi_lbasize;
1063 dk_ioc.dki_length = NBLOCKS(vtoc->efi_nparts,
1071 nblocks = dk_ioc.dki_length / vtoc->efi_lbasize - 1;
1079 if ((dk_ioc.dki_data = calloc(dk_ioc.dki_length, 1)) == NULL)
1082 efi = dk_ioc.dki_data;
1100 efi_parts = (efi_gpe_t *)((char *)dk_ioc.dki_data + vtoc->efi_lbasize);
1169 if (efi_ioctl(fd, DKIOCSETEFI, &dk_ioc) == -1) {
1170 free(dk_ioc.dki_data);
1182 free(dk_ioc.dki_data);
1187 dk_ioc.dki_lba = vtoc->efi_last_u_lba + 1;
1188 dk_ioc.dki_length -= vtoc->efi_lbasize;
1190 dk_ioc.dki_data = (efi_gpt_t *)((char *)dk_ioc.dki_data +
1193 if (efi_ioctl(fd, DKIOCSETEFI, &dk_ioc) == -1) {
1209 dk_ioc.dki_lba = lba_backup_gpt_hdr;
1210 dk_ioc.dki_length = vtoc->efi_lbasize;
1212 dk_ioc.dki_data = (efi_gpt_t *)((char *)dk_ioc.dki_data -
1219 LE_32(efi_crc32((unsigned char *)dk_ioc.dki_data,
1222 if (efi_ioctl(fd, DKIOCSETEFI, &dk_ioc) == -1) {
1233 free(dk_ioc.dki_data);