/illumos-gate/usr/src/lib/libefi/common/ |
H A D | rdwr_efi.c | 174 efi_alloc_and_init(int fd, uint32_t nparts, struct dk_gpt **vtoc) in efi_alloc_and_init() argument 208 if ((*vtoc = calloc(1, length)) == NULL) in efi_alloc_and_init() 211 vptr = *vtoc; in efi_alloc_and_init() 235 efi_alloc_and_read(int fd, struct dk_gpt **vtoc) in efi_alloc_and_read() argument 276 if ((*vtoc = calloc(1, length)) == NULL) in efi_alloc_and_read() 279 (*vtoc)->efi_nparts = nparts; in efi_alloc_and_read() 280 rval = efi_read(fd, *vtoc); in efi_alloc_and_read() 282 if ((rval == VT_EINVAL) && (*vtoc)->efi_nparts > nparts) { in efi_alloc_and_read() 286 ((*vtoc)->efi_nparts - 1); in efi_alloc_and_read() 287 nparts = (*vtoc)->efi_nparts; in efi_alloc_and_read() [all …]
|
/illumos-gate/usr/src/lib/libadm/common/ |
H A D | rdwr_vtoc.c | 81 read_vtoc(int fd, struct vtoc *vtoc) in read_vtoc() argument 88 if (ioctl(fd, DKIOCGVTOC, (caddr_t)vtoc) == -1) { in read_vtoc() 107 if (vtoc->v_sanity != VTOC_SANE) { in read_vtoc() 114 switch (vtoc->v_version) { in read_vtoc() 123 vtoc->v_version = V_VERSION; in read_vtoc() 124 if (vtoc->v_nparts == 0) in read_vtoc() 125 vtoc->v_nparts = V_NUMPAR; in read_vtoc() 126 if (vtoc->v_sectorsz == 0) in read_vtoc() 127 vtoc->v_sectorsz = DEV_BSIZE; in read_vtoc() 161 write_vtoc(int fd, struct vtoc *vtoc) in write_vtoc() argument [all …]
|
/illumos-gate/usr/src/cmd/fmthard/ |
H A D | fmthard.c | 382 display(struct dk_geom *geom, struct extvtoc *vtoc, char *device) in display() argument 391 if (*vtoc->v_volume) { in display() 394 if ((c = vtoc->v_volume[i]) == 0) in display() 415 if (vtoc->v_part[i].p_size > 0) in display() 418 i, vtoc->v_part[i].p_tag, in display() 419 vtoc->v_part[i].p_flag, in display() 420 vtoc->v_part[i].p_start, in display() 421 vtoc->v_part[i].p_size); in display() 473 insert(char *data, struct extvtoc *vtoc) in insert() argument 492 vtoc->v_part[part].p_tag = (ushort_t)tag; in insert() [all …]
|
/illumos-gate/usr/src/cmd/format/ |
H A D | label.c | 257 struct extvtoc vtoc; in write_label() local 330 label.dkl_vtoc = cur_parts->vtoc; in write_label() 358 if (label_to_vtoc(&vtoc, &label) == -1) { in write_label() 411 if (write_extvtoc(cur_file, &vtoc) != 0) { in write_label() 469 struct extvtoc vtoc; in read_label() local 473 if (read_extvtoc(fd, &vtoc) < 0 || in read_label() 479 return (vtoc_to_label(label, &vtoc, &geom, &dkinfo)); in read_label() 676 vtoc64_to_label(struct efi_info *label, struct dk_gpt *vtoc) in vtoc64_to_label() argument 684 nparts = vtoc->efi_nparts; in vtoc64_to_label() 697 lmap->efi_version = vtoc->efi_version; in vtoc64_to_label() [all …]
|
H A D | partition.c | 210 assert(cur_parts->vtoc.v_version == V_VERSION); in change_partition() 211 deflt = cur_parts->vtoc.v_part[num].p_tag; in change_partition() 216 deflt = cur_parts->vtoc.v_part[num].p_flag; in change_partition() 339 cur_parts->vtoc.v_part[num].p_start = (daddr_t)(i * (nhead * nsect)); in change_partition() 340 cur_parts->vtoc.v_part[num].p_size = (long)j; in change_partition() 346 assert(cur_parts->vtoc.v_version == V_VERSION); in change_partition() 347 cur_parts->vtoc.v_part[num].p_tag = (ushort_t)tag; in change_partition() 348 cur_parts->vtoc.v_part[num].p_flag = (ushort_t)flag; in change_partition() 457 pptr->vtoc = cur_parts->vtoc; in make_partition() 515 bzero((caddr_t)&part->vtoc, sizeof (struct dk_vtoc)); in set_vtoc_defaults() [all …]
|
H A D | auto_sense.c | 244 struct dk_gpt *vtoc; in auto_efi_sense() local 283 if (efi_alloc_and_init(fd, EFI_NUMPAR, &vtoc) != 0) { in auto_efi_sense() 288 label->e_parts = vtoc; in auto_efi_sense() 289 reserved = efi_reserved_sectors(vtoc); in auto_efi_sense() 296 vtoc->efi_parts[0].p_tag = V_USR; in auto_efi_sense() 297 vtoc->efi_parts[0].p_start = vtoc->efi_first_u_lba; in auto_efi_sense() 298 vtoc->efi_parts[0].p_size = vtoc->efi_last_u_lba - vtoc->efi_first_u_lba in auto_efi_sense() 304 for (i = 1; i < vtoc->efi_nparts - 2; i ++) { in auto_efi_sense() 305 vtoc->efi_parts[i].p_tag = V_UNASSIGNED; in auto_efi_sense() 306 vtoc->efi_parts[i].p_start = 0; in auto_efi_sense() [all …]
|
H A D | menu_fdisk.c | 435 if (cur_parts->vtoc.v_part[i].p_tag && in update_cur_parts() 436 cur_parts->vtoc.v_part[i].p_tag != V_ALTSCTR) { in update_cur_parts() 437 cur_parts->vtoc.v_part[i].p_start = 0; in update_cur_parts() 438 cur_parts->vtoc.v_part[i].p_size = 0; in update_cur_parts() 443 cur_parts->vtoc.v_part[i].p_tag = in update_cur_parts() 445 cur_parts->vtoc.v_part[i].p_flag = in update_cur_parts() 459 cur_parts->vtoc.v_part[C_PARTITION].p_start = in update_cur_parts() 461 cur_parts->vtoc.v_part[C_PARTITION].p_size = in update_cur_parts() 464 cur_parts->vtoc.v_part[I_PARTITION].p_start = in update_cur_parts() 466 cur_parts->vtoc.v_part[I_PARTITION].p_size = in update_cur_parts() [all …]
|
H A D | startup.c | 1173 vtoc_tag = pinfo->vtoc.v_part[index].p_tag; in sup_setpart() 1174 vtoc_flag = pinfo->vtoc.v_part[index].p_flag; in sup_setpart() 1267 pinfo->vtoc.v_part[index].p_tag = vtoc_tag; in sup_setpart() 1268 pinfo->vtoc.v_part[index].p_flag = vtoc_flag; in sup_setpart() 1271 pinfo->vtoc.v_part[index].p_start = val1 * (nhead * nsect); in sup_setpart() 1272 pinfo->vtoc.v_part[index].p_size = val2; in sup_setpart() 1275 pinfo->vtoc.v_part[index].p_tag = 0; in sup_setpart() 1276 pinfo->vtoc.v_part[index].p_flag = 0; in sup_setpart() 1277 pinfo->vtoc.v_part[index].p_start = 0; in sup_setpart() 2199 search_parts->vtoc = search_label.dkl_vtoc; in add_device_to_disklist() [all …]
|
H A D | modify_partition.c | 154 tmp_pinfo->vtoc = cur_parts->vtoc; in p_modify() 307 cur_parts->vtoc.v_part[i].p_start = in p_modify() 309 cur_parts->vtoc.v_part[i].p_size = in p_modify() 523 part->vtoc = label->dkl_vtoc;
|
H A D | menu_partition.c | 306 cur_parts->vtoc.v_part[i].p_start = in p_select() 309 cur_parts->vtoc.v_part[i].p_size = in p_select() 595 s = find_string(ptag_choices, (int)pinfo->vtoc.v_part[partnum].p_tag); in print_partition() 604 s = find_string(pflag_choices, (int)pinfo->vtoc.v_part[partnum].p_flag); in print_partition()
|
/illumos-gate/usr/src/uts/sun4v/sys/ |
H A D | vdsk_common.h | 383 #define VD_VTOC2VTOC(vd_vtoc, vtoc) \ argument 385 bzero((vtoc), sizeof (*(vtoc))); \ 386 bcopy((vd_vtoc)->volume_name, (vtoc)->v_volume, \ 388 sizeof ((vtoc)->v_volume))); \ 389 bcopy((vd_vtoc)->ascii_label, (vtoc)->v_asciilabel, \ 391 sizeof ((vtoc)->v_asciilabel))); \ 392 (vtoc)->v_sanity = VTOC_SANE; \ 393 (vtoc)->v_version = V_VERSION; \ 394 (vtoc)->v_sectorsz = (vd_vtoc)->sector_size; \ 395 (vtoc)->v_nparts = (vd_vtoc)->num_partitions; \ [all …]
|
/illumos-gate/usr/src/lib/libdiskmgt/common/ |
H A D | slice.c | 359 struct extvtoc vtoc; in get_attrs() local 374 if ((status = read_extvtoc(fd, &vtoc)) >= 0) { in get_attrs() 394 if (snum < 0 || snum >= vtoc.v_nparts || in get_attrs() 395 vtoc.v_part[snum].p_size == 0) { in get_attrs() 417 vtoc.v_part[snum].p_start) != 0) { in get_attrs() 422 vtoc.v_part[snum].p_size) != 0) { in get_attrs() 427 vtoc.v_part[snum].p_tag) != 0) { in get_attrs() 432 vtoc.v_part[snum].p_flag) != 0) { in get_attrs() 522 struct extvtoc vtoc; in get_fixed_assocs() local 534 if ((status = read_extvtoc(fd, &vtoc)) >= 0) { in get_fixed_assocs() [all …]
|
H A D | media.c | 422 struct extvtoc vtoc; local 457 if (read_extvtoc(fd, &vtoc) >= 0 && vtoc.v_volume[0] != 0) { 461 LEN_DKL_VVOL, vtoc.v_volume); 549 struct extvtoc vtoc; local 551 if (read_extvtoc(fd, &vtoc) >= 0) { 552 if (vtoc.v_volume[0] != '\0') { 555 vtoc.v_volume, 559 vtoc.v_volume, size);
|
/illumos-gate/usr/src/cmd/prtvtoc/ |
H A D | prtvtoc.c | 155 findfree(struct dk_geom *geom, struct extvtoc *vtoc) in findfree() argument 164 if (vtoc->v_nparts > V_NUMPAR) { in findfree() 172 for (part = vtoc->v_part; part < vtoc->v_part + vtoc->v_nparts; in findfree() 390 struct extvtoc vtoc; in prtvtoc() local 420 if ((idx = readvtoc(fd, name, &vtoc)) == VT_ENOTSUP) { in prtvtoc() 431 freemap = findfree(&geom, &vtoc); in prtvtoc() 436 putfree(&vtoc, freemap); in prtvtoc() 441 puttable(&geom, &vtoc, freemap, devname, in prtvtoc() 463 putfree(struct extvtoc *vtoc, freemap_t *freemap) in putfree() argument 475 for (idx = 0; idx < vtoc->v_nparts; ++idx) { in putfree() [all …]
|
/illumos-gate/usr/src/uts/sun4v/io/ |
H A D | vds.c | 478 struct extvtoc vtoc; /* synthetic for slice type */ member 683 static void vd_vtocgeom_to_label(struct extvtoc *vtoc, struct dk_geom *geom, 685 static void vd_label_to_vtocgeom(struct dk_label *label, struct extvtoc *vtoc, 688 static boolean_t vd_slice_vtoc_isvalid(vd_t *vd, struct extvtoc *vtoc); 802 ASSERT(vd->vtoc.v_sectorsz == DEV_BSIZE); in vd_dskimg_io_params() 1664 struct extvtoc vtoc; in vd_slice_flabel_write() local 1687 vd_label_to_vtocgeom(label, &vtoc, &geom); in vd_slice_flabel_write() 1689 vd_slice_vtoc_isvalid(vd, &vtoc)) in vd_slice_flabel_write() 2860 vd_vtocgeom_to_label(struct extvtoc *vtoc, struct dk_geom *geom, in vd_vtocgeom_to_label() argument 2865 ASSERT(vtoc->v_nparts == V_NUMPAR); in vd_vtocgeom_to_label() [all …]
|
H A D | vdc.c | 611 if (vdc->vtoc) in vdc_detach() 612 kmem_free(vdc->vtoc, sizeof (struct extvtoc)); in vdc_detach() 685 vdc->vtoc = NULL; in vdc_do_attach() 733 vdc->vtoc = kmem_zalloc(sizeof (struct extvtoc), KM_SLEEP); in vdc_do_attach() 5589 struct extvtoc *vtoc; in vdc_dkio_gapart() local 5608 vtoc = vdc->vtoc; in vdc_dkio_gapart() 5613 for (i = 0; i < vtoc->v_nparts; i++) { in vdc_dkio_gapart() 5614 data.map32[i].dkl_cylno = vtoc->v_part[i].p_start / in vdc_dkio_gapart() 5616 data.map32[i].dkl_nblk = vtoc->v_part[i].p_size; in vdc_dkio_gapart() 5622 for (i = 0; i < vtoc->v_nparts; i++) { in vdc_dkio_gapart() [all …]
|
/illumos-gate/usr/src/cmd/addbadsec/ |
H A D | addbadsec.c | 58 struct extvtoc vtoc; /* table of contents */ variable 176 if (ioctl(devfd, DKIOCGEXTVTOC, &vtoc) == -1) { in main() 182 if ((vtoc.v_sanity != VTOC_SANE) || (vtoc.v_version != V_VERSION)) { in main() 221 if (vtoc.v_part[i].p_tag == V_ALTSCTR) in main() 224 part = &vtoc.v_part[i]; in main()
|
/illumos-gate/usr/src/uts/sun/io/ |
H A D | fd.c | 189 static int fd_build_label_vtoc(struct fdunit *, struct vtoc *); 190 static void fd_build_user_vtoc(struct fdunit *, struct vtoc *); 1886 struct vtoc vtoc; in fd_ioctl() local 2064 fd_build_user_vtoc(un, &vtoc); in fd_ioctl() 2072 vtoctovtoc32(vtoc, vtoc32); in fd_ioctl() 2080 if (ddi_copyout(&vtoc, (void *)arg, in fd_ioctl() 2081 sizeof (vtoc), flag)) in fd_ioctl() 2086 if (ddi_copyout(&vtoc, (void *)arg, sizeof (vtoc), flag)) in fd_ioctl() 2102 vtoc32tovtoc(vtoc32, vtoc); in fd_ioctl() 2107 if (ddi_copyin((const void *)arg, &vtoc, in fd_ioctl() [all …]
|
/illumos-gate/usr/src/lib/libzfs/common/ |
H A D | libzfs_pool.c | 4535 struct dk_gpt *vtoc; in read_efi_label() local 4537 if ((err = efi_alloc_and_read(fd, &vtoc)) >= 0) { in read_efi_label() 4538 for (slice = 0; slice < vtoc->efi_nparts; slice++) { in read_efi_label() 4539 if (vtoc->efi_parts[slice].p_tag == V_SYSTEM) in read_efi_label() 4541 if (vtoc->efi_parts[slice].p_tag == V_USR) in read_efi_label() 4544 if (sb != NULL && vtoc->efi_parts[slice].p_tag == V_USR) in read_efi_label() 4545 *sb = vtoc->efi_parts[slice].p_start; in read_efi_label() 4548 efi_free(vtoc); in read_efi_label() 4597 struct dk_gpt *vtoc; in zpool_label_disk() local 4637 if (efi_alloc_and_init(fd, EFI_NUMPAR, &vtoc) != 0) { in zpool_label_disk() [all …]
|
/illumos-gate/usr/src/cmd/hal/probing/volume/ |
H A D | probe-volume.c | 443 struct extvtoc vtoc; in main() local 564 if ((partition_number = read_extvtoc(rfd, &vtoc)) >= 0) { in main() 565 if (!vtoc_one_slice_entire_disk(&vtoc)) { in main() 567 if (partition_number < vtoc.v_nparts) { in main() 568 if (vtoc.v_part[partition_number].p_size == 0) { in main() 571 partition_start = vtoc.v_part[partition_number].p_start * block_size; in main()
|
/illumos-gate/usr/src/cmd/devinfo/ |
H A D | devinfo.c | 64 static int readvtoc(int fd, char *name, struct extvtoc *vtoc); 209 readvtoc(int fd, char *name, struct extvtoc *vtoc) in readvtoc() argument 213 retval = read_extvtoc(fd, vtoc); in readvtoc()
|
/illumos-gate/usr/src/cmd/svr4pkg/hdrs/ |
H A D | libadm.h | 311 extern int read_vtoc __P((int fd, struct vtoc *vtoc)); 312 extern int write_vtoc __P((int fd, struct vtoc *vtoc));
|
/illumos-gate/usr/src/cmd/boot/installboot/i386/ |
H A D | installboot.c | 1069 get_slice(ib_data_t *data, struct partlist *pl, struct dk_gpt *vtoc, in get_slice() argument 1079 for (i = 0; i < vtoc->efi_nparts; i++) { in get_slice() 1080 if (vtoc->efi_parts[i].p_tag == tag) { in get_slice() 1097 switch (vtoc->efi_parts[i].p_tag) { in get_slice() 1107 device->stage.tag = vtoc->efi_parts[i].p_tag; in get_slice() 1108 device->stage.start = vtoc->efi_parts[i].p_start; in get_slice() 1109 device->stage.size = vtoc->efi_parts[i].p_size; in get_slice() 1117 allocate_slice(ib_data_t *data, struct dk_gpt *vtoc, uint16_t tag, in allocate_slice() argument 1132 if (!get_slice(data, pl, vtoc, tag)) { in allocate_slice() 1150 struct dk_gpt *vtoc; in probe_gpt() local [all …]
|
/illumos-gate/usr/src/cmd/hal/utils/ |
H A D | fsutils.c | 224 vtoc_one_slice_entire_disk(struct extvtoc *vtoc) in vtoc_one_slice_entire_disk() argument 231 for (i = 0; i < vtoc->v_nparts; i++) { in vtoc_one_slice_entire_disk() 232 p = &vtoc->v_part[i]; in vtoc_one_slice_entire_disk()
|
/illumos-gate/usr/src/cmd/fs.d/udfs/fsck/ |
H A D | setup.c | 623 struct vtoc vtoc; in get_last_block() local 626 if (ioctl(fsreadfd, DKIOCGVTOC, (intptr_t)&vtoc) != 0) { in get_last_block() 631 if (vtoc.v_sanity != VTOC_SANE) { in get_last_block() 648 return ((uint32_t)vtoc.v_part[dki_info.dki_partition].p_size); in get_last_block()
|