Lines Matching refs:lba

50 static int is_gpt_valid(struct blk_desc *dev_desc, u64 lba,
79 static int validate_gpt_header(gpt_header *gpt_h, lbaint_t lba, in validate_gpt_header() argument
113 if (le64_to_cpu(gpt_h->my_lba) != lba) { in validate_gpt_header()
116 lba); in validate_gpt_header()
199 if (is_gpt_valid(dev_desc, dev_desc->lba - 1, in get_disk_guid()
228 if (is_gpt_valid(dev_desc, (dev_desc->lba - 1), in part_print_efi()
289 if (is_gpt_valid(dev_desc, (dev_desc->lba - 1), in part_get_info_efi()
377 p_mbr->partition_record[0].nr_sects = (u32) dev_desc->lba - 1; in set_protective_mbr()
396 debug("max lba: %x\n", (u32) dev_desc->lba); in write_gpt_table()
611 gpt_h->alternate_lba = cpu_to_le64(dev_desc->lba - 1); in gpt_fill_header()
612 gpt_h->last_usable_lba = cpu_to_le64(dev_desc->lba - 34); in gpt_fill_header()
700 if (is_gpt_valid(dev_desc, (dev_desc->lba - 1), in gpt_verify_headers()
797 dev_desc->lba)) in is_valid_gpt_buf()
814 lbaint_t lba; in write_mbr_and_gpt_partitions() local
832 lba = 0; /* MBR is always at 0 */ in write_mbr_and_gpt_partitions()
834 if (blk_dwrite(dev_desc, lba, cnt, buf) != cnt) { in write_mbr_and_gpt_partitions()
836 __func__, "MBR", cnt, lba); in write_mbr_and_gpt_partitions()
841 lba = GPT_PRIMARY_PARTITION_TABLE_LBA; in write_mbr_and_gpt_partitions()
843 if (blk_dwrite(dev_desc, lba, cnt, gpt_h) != cnt) { in write_mbr_and_gpt_partitions()
845 __func__, "Primary GPT Header", cnt, lba); in write_mbr_and_gpt_partitions()
849 lba = le64_to_cpu(gpt_h->partition_entry_lba); in write_mbr_and_gpt_partitions()
851 if (blk_dwrite(dev_desc, lba, cnt, gpt_e) != cnt) { in write_mbr_and_gpt_partitions()
853 __func__, "Primary GPT Entries", cnt, lba); in write_mbr_and_gpt_partitions()
860 lba = le64_to_cpu(gpt_h->partition_entry_lba); in write_mbr_and_gpt_partitions()
862 if (blk_dwrite(dev_desc, lba, cnt, gpt_e) != cnt) { in write_mbr_and_gpt_partitions()
864 __func__, "Backup GPT Entries", cnt, lba); in write_mbr_and_gpt_partitions()
868 lba = le64_to_cpu(gpt_h->my_lba); in write_mbr_and_gpt_partitions()
870 if (blk_dwrite(dev_desc, lba, cnt, gpt_h) != cnt) { in write_mbr_and_gpt_partitions()
872 __func__, "Backup GPT Header", cnt, lba); in write_mbr_and_gpt_partitions()
931 static int is_gpt_valid(struct blk_desc *dev_desc, u64 lba, in is_gpt_valid() argument
949 if (blk_dread(dev_desc, (lbaint_t)lba, 1, pgpt_head) != 1) { in is_gpt_valid()
954 if (validate_gpt_header(pgpt_head, (lbaint_t)lba, dev_desc->lba)) in is_gpt_valid()