gpt: rename misnamed header location fields
The header location fields refer to 'this header' and 'alternate header' respectively, not 'primary header' and 'backup header'. The previous field names are backwards for the backup header.
This commit is contained in:
parent
7ac3d8a7bf
commit
3b2674aef7
3 changed files with 7 additions and 7 deletions
|
@ -137,7 +137,7 @@ grub_gpt_read_backup (grub_disk_t disk, grub_gpt_t gpt)
|
|||
if (disk->total_sectors != GRUB_DISK_SIZE_UNKNOWN)
|
||||
sector = disk->total_sectors - 1;
|
||||
else if (gpt->status & GRUB_GPT_PRIMARY_HEADER_VALID)
|
||||
sector = grub_le_to_cpu64 (gpt->primary.backup);
|
||||
sector = grub_le_to_cpu64 (gpt->primary.alternate_lba);
|
||||
else
|
||||
return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
|
||||
"Unable to locate backup GPT");
|
||||
|
|
|
@ -64,8 +64,8 @@ struct grub_gpt_header
|
|||
grub_uint32_t headersize;
|
||||
grub_uint32_t crc32;
|
||||
grub_uint32_t unused1;
|
||||
grub_uint64_t primary;
|
||||
grub_uint64_t backup;
|
||||
grub_uint64_t header_lba;
|
||||
grub_uint64_t alternate_lba;
|
||||
grub_uint64_t start;
|
||||
grub_uint64_t end;
|
||||
grub_uint8_t guid[16];
|
||||
|
|
|
@ -94,8 +94,8 @@ static const struct grub_gpt_header example_primary = {
|
|||
.version = GRUB_GPT_HEADER_VERSION,
|
||||
.headersize = sizeof (struct grub_gpt_header),
|
||||
.crc32 = grub_cpu_to_le32_compile_time (0x7cd8642c),
|
||||
.primary = grub_cpu_to_le64_compile_time (PRIMARY_HEADER_SECTOR),
|
||||
.backup = grub_cpu_to_le64_compile_time (BACKUP_HEADER_SECTOR),
|
||||
.header_lba = grub_cpu_to_le64_compile_time (PRIMARY_HEADER_SECTOR),
|
||||
.alternate_lba = grub_cpu_to_le64_compile_time (BACKUP_HEADER_SECTOR),
|
||||
.start = grub_cpu_to_le64_compile_time (DATA_START_SECTOR),
|
||||
.end = grub_cpu_to_le64_compile_time (DATA_END_SECTOR),
|
||||
.guid = {0xad, 0x31, 0xc1, 0x69, 0xd6, 0x67, 0xc6, 0x46,
|
||||
|
@ -112,8 +112,8 @@ static const struct grub_gpt_header example_backup = {
|
|||
.version = GRUB_GPT_HEADER_VERSION,
|
||||
.headersize = sizeof (struct grub_gpt_header),
|
||||
.crc32 = grub_cpu_to_le32_compile_time (0xcfaa4a27),
|
||||
.primary = grub_cpu_to_le64_compile_time (BACKUP_HEADER_SECTOR),
|
||||
.backup = grub_cpu_to_le64_compile_time (PRIMARY_HEADER_SECTOR),
|
||||
.header_lba = grub_cpu_to_le64_compile_time (BACKUP_HEADER_SECTOR),
|
||||
.alternate_lba = grub_cpu_to_le64_compile_time (PRIMARY_HEADER_SECTOR),
|
||||
.start = grub_cpu_to_le64_compile_time (DATA_START_SECTOR),
|
||||
.end = grub_cpu_to_le64_compile_time (DATA_END_SECTOR),
|
||||
.guid = {0xad, 0x31, 0xc1, 0x69, 0xd6, 0x67, 0xc6, 0x46,
|
||||
|
|
Loading…
Reference in a new issue