Lines Matching refs:lba

46 static int is_gpt_valid(struct blk_desc *dev_desc, u64 lba,
76 static int validate_gpt_header(gpt_header *gpt_h, lbaint_t lba, in validate_gpt_header() argument
111 if (le64_to_cpu(gpt_h->my_lba) != lba) { in validate_gpt_header()
114 lba); in validate_gpt_header()
207 if (is_gpt_valid(dev_desc, dev_desc->lba - 1, in get_disk_guid()
236 if (is_gpt_valid(dev_desc, (dev_desc->lba - 1), in part_print_efi()
294 if (gpt_head && (gpt_head->last_usable_lba + 0x22) != dev_desc->lba) { in part_get_info_efi()
310 if (is_gpt_valid(dev_desc, (dev_desc->lba - 1), in part_get_info_efi()
368 if (gpt_pte[i - 1].ending_lba <= (dev_desc->lba - 0x22)) in gpt_entry_modify()
371 gpt_pte[i - 1].ending_lba = dev_desc->lba - 0x41; in gpt_entry_modify()
392 gpt_head->my_lba = dev_desc->lba - 1; in part_efi_repair()
394 gpt_head->partition_entry_lba = dev_desc->lba - 0x21; in part_efi_repair()
395 gpt_head->last_usable_lba = cpu_to_le64(dev_desc->lba - 34); in part_efi_repair()
400 if (blk_dwrite(dev_desc, dev_desc->lba - 1, 1, gpt_head) != 1) { in part_efi_repair()
417 gpt_head->alternate_lba = dev_desc->lba - 1; in part_efi_repair()
419 gpt_head->last_usable_lba = cpu_to_le64(dev_desc->lba - 34); in part_efi_repair()
471 backup_gpt_valid = is_gpt_valid(dev_desc, (dev_desc->lba - 1), in part_test_efi()
536 p_mbr->partition_record[0].nr_sects = (u32) dev_desc->lba - 1; in set_protective_mbr()
555 debug("max lba: %x\n", (u32) dev_desc->lba); in write_gpt_table()
770 gpt_h->alternate_lba = cpu_to_le64(dev_desc->lba - 1); in gpt_fill_header()
771 gpt_h->last_usable_lba = cpu_to_le64(dev_desc->lba - 34); in gpt_fill_header()
868 if (is_gpt_valid(dev_desc, (dev_desc->lba - 1), in gpt_verify_headers()
966 != cpu_to_le64(dev_desc->lba) && in is_valid_gpt_buf()
974 dev_desc->lba)) in is_valid_gpt_buf()
991 lbaint_t lba; in write_mbr_and_gpt_partitions() local
1009 lba = 0; /* MBR is always at 0 */ in write_mbr_and_gpt_partitions()
1011 if (blk_dwrite(dev_desc, lba, cnt, buf) != cnt) { in write_mbr_and_gpt_partitions()
1013 __func__, "MBR", cnt, lba); in write_mbr_and_gpt_partitions()
1018 lba = GPT_PRIMARY_PARTITION_TABLE_LBA; in write_mbr_and_gpt_partitions()
1020 if (blk_dwrite(dev_desc, lba, cnt, gpt_h) != cnt) { in write_mbr_and_gpt_partitions()
1022 __func__, "Primary GPT Header", cnt, lba); in write_mbr_and_gpt_partitions()
1026 lba = le64_to_cpu(gpt_h->partition_entry_lba); in write_mbr_and_gpt_partitions()
1028 if (blk_dwrite(dev_desc, lba, cnt, gpt_e) != cnt) { in write_mbr_and_gpt_partitions()
1030 __func__, "Primary GPT Entries", cnt, lba); in write_mbr_and_gpt_partitions()
1037 lba = le64_to_cpu(gpt_h->partition_entry_lba); in write_mbr_and_gpt_partitions()
1039 if (blk_dwrite(dev_desc, lba, cnt, gpt_e) != cnt) { in write_mbr_and_gpt_partitions()
1041 __func__, "Backup GPT Entries", cnt, lba); in write_mbr_and_gpt_partitions()
1045 lba = le64_to_cpu(gpt_h->my_lba); in write_mbr_and_gpt_partitions()
1047 if (blk_dwrite(dev_desc, lba, cnt, gpt_h) != cnt) { in write_mbr_and_gpt_partitions()
1049 __func__, "Backup GPT Header", cnt, lba); in write_mbr_and_gpt_partitions()
1120 static int is_gpt_valid(struct blk_desc *dev_desc, u64 lba, in is_gpt_valid() argument
1142 if (blk_dread(dev_desc, (lbaint_t)lba, 1, pgpt_head) != 1) { in is_gpt_valid()
1147 if (validate_gpt_header(pgpt_head, (lbaint_t)lba, dev_desc->lba)) in is_gpt_valid()