• Home
  • Raw
  • Download

Lines Matching refs:state

251 static size_t read_lba(struct parsed_partitions *state,  in read_lba()  argument
255 struct block_device *bdev = state->bdev; in read_lba()
264 unsigned char *data = read_part_sector(state, n++, &sect); in read_lba()
287 static gpt_entry *alloc_read_gpt_entries(struct parsed_partitions *state, in alloc_read_gpt_entries() argument
304 if (read_lba(state, le64_to_cpu(gpt->partition_entry_lba), in alloc_read_gpt_entries()
322 static gpt_header *alloc_read_gpt_header(struct parsed_partitions *state, in alloc_read_gpt_header() argument
326 unsigned ssz = bdev_logical_block_size(state->bdev); in alloc_read_gpt_header()
332 if (read_lba(state, lba, (u8 *) gpt, ssz) < ssz) { in alloc_read_gpt_header()
351 static int is_gpt_valid(struct parsed_partitions *state, u64 lba, in is_gpt_valid() argument
359 if (!(*gpt = alloc_read_gpt_header(state, lba))) in is_gpt_valid()
373 bdev_logical_block_size(state->bdev)) { in is_gpt_valid()
376 bdev_logical_block_size(state->bdev)); in is_gpt_valid()
412 lastlba = last_lba(state->bdev); in is_gpt_valid()
446 if (!(*ptes = alloc_read_gpt_entries(state, *gpt))) in is_gpt_valid()
597 static int find_valid_gpt(struct parsed_partitions *state, gpt_header **gpt, in find_valid_gpt() argument
604 sector_t total_sectors = i_size_read(state->bdev->bd_inode) >> 9; in find_valid_gpt()
610 lastlba = last_lba(state->bdev); in find_valid_gpt()
617 read_lba(state, 0, (u8 *)legacymbr, sizeof(*legacymbr)); in find_valid_gpt()
629 good_pgpt = is_gpt_valid(state, GPT_PRIMARY_PARTITION_TABLE_LBA, in find_valid_gpt()
632 good_agpt = is_gpt_valid(state, in find_valid_gpt()
636 good_agpt = is_gpt_valid(state, lastlba, &agpt, &aptes); in find_valid_gpt()
692 int efi_partition(struct parsed_partitions *state) in efi_partition() argument
697 unsigned ssz = bdev_logical_block_size(state->bdev) / 512; in efi_partition()
699 if (!find_valid_gpt(state, &gpt, &ptes) || !gpt || !ptes) { in efi_partition()
707 for (i = 0; i < le32_to_cpu(gpt->num_partition_entries) && i < state->limit-1; i++) { in efi_partition()
715 if (!is_pte_valid(&ptes[i], last_lba(state->bdev))) in efi_partition()
718 put_partition(state, i+1, start * ssz, size * ssz); in efi_partition()
722 state->parts[i + 1].flags = ADDPART_FLAG_RAID; in efi_partition()
724 info = &state->parts[i + 1].info; in efi_partition()
738 state->parts[i + 1].has_info = true; in efi_partition()
742 strlcat(state->pp_buf, "\n", PAGE_SIZE); in efi_partition()