• Home
  • Raw
  • Download

Lines Matching refs:gpth

125 	const struct disk_gpt_header *gpth, const struct disk_gpt_part_entry *gptl  in pi_gpt_ctor()  argument
133 siz = (uint64_t)gpth->part_count * gpth->part_size; in pi_gpt_ctor()
142 iter->gpt.pe_count = (int)gpth->part_count; in pi_gpt_ctor()
143 iter->gpt.pe_size = (int)gpth->part_size; in pi_gpt_ctor()
144 iter->gpt.ufirst = gpth->lba_first_usable; in pi_gpt_ctor()
145 iter->gpt.ulast = gpth->lba_last_usable; in pi_gpt_ctor()
147 memcpy(&iter->gpt.disk_guid, &gpth->disk_guid, sizeof gpth->disk_guid); in pi_gpt_ctor()
148 memcpy(&iter->gpt.part_guid, &gpth->disk_guid, sizeof gpth->disk_guid); in pi_gpt_ctor()
543 struct disk_gpt_header *gpth; in try_gpt_hdr() local
546 gpth = disk_read_sectors(di, gpt_cur, 1); in try_gpt_hdr()
547 if (!gpth) { in try_gpt_hdr()
552 if(!valid_crc_hdr(gpth)) { in try_gpt_hdr()
555 free(gpth); in try_gpt_hdr()
558 return gpth; in try_gpt_hdr()
561 …t_part_entry *try_gpt_list(const struct disk_info *di, const struct disk_gpt_header *gpth, int alt) in try_gpt_list() argument
563 int pri = gpth->lba_cur < gpth->lba_alt; in try_gpt_list()
571 gpt_lsiz = (uint64_t)gpth->part_size * gpth->part_count; in try_gpt_list()
575 gpt_loff = gpth->lba_table; in try_gpt_list()
579 gpt_loff = gpth->lba_alt + 1; in try_gpt_list()
581 gpt_loff = gpth->lba_alt - gpt_lcnt; in try_gpt_list()
590 if (!valid_crc(gpth->table_chksum, (const uint8_t *)gptl, gpt_lsiz)) { in try_gpt_list()
599 static int notsane_gpt_hdr(const struct disk_info *di, const struct disk_gpt_header *gpth, int flag… in notsane_gpt_hdr() argument
609 if (gpth->lba_alt < gpth->lba_cur) in notsane_gpt_hdr()
610 gpt_sec = gpth->lba_cur; in notsane_gpt_hdr()
612 gpt_sec = gpth->lba_alt; in notsane_gpt_hdr()
613 gpt_loff = gpth->lba_table; in notsane_gpt_hdr()
614 gpt_lsiz = (uint64_t)gpth->part_size * gpth->part_count; in notsane_gpt_hdr()
622 gpth->lba_first_usable > gpth->lba_last_usable || in notsane_gpt_hdr()
624 (gpt_loff + gpt_lcnt > gpth->lba_first_usable && gpt_loff <= gpth->lba_last_usable) || in notsane_gpt_hdr()
627 gpth->part_size < sizeof(struct disk_gpt_part_entry)) in notsane_gpt_hdr()
639 struct disk_gpt_header *gpth = NULL; in pi_begin() local
667 gpth = try_gpt_hdr(di, 0); in pi_begin()
668 if (!gpth) in pi_begin()
673 gpth = try_gpt_hdr(di, 1); in pi_begin()
674 if (!gpth) in pi_begin()
678 if (gpth && gpth->rev.uint32 == 0x00010000 && in pi_begin()
679 !memcmp(gpth->sig, disk_gpt_sig_magic, sizeof gpth->sig)) { in pi_begin()
683 disk_gpt_header_dump(gpth); in pi_begin()
685 if (notsane_gpt_hdr(di, gpth, flags)) { in pi_begin()
690 gptl = try_gpt_list(di, gpth, 0); in pi_begin()
692 gptl = try_gpt_list(di, gpth, 1); in pi_begin()
697 ret = pi_gpt_ctor(iter, di, flags, gpth, gptl); in pi_begin()
708 free(gpth); in pi_begin()