Lines Matching full:disk
20 * - check for first/last_usable_lba outside of size of disk
26 * - On-disk structure and copy in memory is *always* LE now -
41 * thing that keeps EFI GUIDs on disk.
61 * sector of an odd-sized disk from user space. No tools have ever
127 * @disk: block device
131 * the part[0] entry for this disk, and is the number of
132 * physical sectors available on the disk.
134 static u64 last_lba(struct gendisk *disk) in last_lba() argument
136 return div_u64(bdev_nr_bytes(disk->part0), in last_lba()
137 queue_logical_block_size(disk->queue)) - 1ULL; in last_lba()
203 * Protective MBRs take up the lesser of the whole disk in is_pmbr_valid()
204 * or 2 TiB (32bit LBA), ignoring the rest of the disk. in is_pmbr_valid()
207 * the disk size. in is_pmbr_valid()
212 * an image from a smaller disk to a larger disk. in is_pmbr_valid()
217 pr_debug("GPT: mbr size in lba (%u) different than whole disk (%u).\n", in is_pmbr_valid()
226 * read_lba(): Read bytes from disk, starting at given LBA
227 * @state: disk parsed partitions
232 * Description: Reads @count bytes from @state->disk into @buffer.
240 (queue_logical_block_size(state->disk->queue) / 512); in read_lba()
242 if (!buffer || lba > last_lba(state->disk)) in read_lba()
263 * alloc_read_gpt_entries(): reads partition entries from disk
264 * @state: disk parsed partitions
298 * alloc_read_gpt_header(): Allocates GPT header, reads into it from disk
299 * @state: disk parsed partitions
303 * and fills a GPT header starting at @ from @state->disk.
310 unsigned ssz = queue_logical_block_size(state->disk->queue); in alloc_read_gpt_header()
327 * @state: disk parsed partitions
357 queue_logical_block_size(state->disk->queue)) { in is_gpt_valid()
360 queue_logical_block_size(state->disk->queue)); in is_gpt_valid()
394 * within the disk. in is_gpt_valid()
396 lastlba = last_lba(state->disk); in is_gpt_valid()
456 * @lastlba: last lba of the disk
471 * compare_gpts() - Search disk for valid GPT headers and PTEs
545 pr_warn("GPT:Primary header thinks Alt. header is not at the end of the disk.\n"); in compare_gpts()
553 pr_warn("GPT:Alternate GPT header not at the end of the disk.\n"); in compare_gpts()
566 * find_valid_gpt() - Search disk for valid GPT headers and PTEs
567 * @state: disk parsed partitions
588 struct gendisk *disk = state->disk; in find_valid_gpt() local
589 const struct block_device_operations *fops = disk->fops; in find_valid_gpt()
590 sector_t total_sectors = get_capacity(state->disk); in find_valid_gpt()
596 lastlba = last_lba(state->disk); in find_valid_gpt()
628 err = fops->alternative_gpt_sector(disk, &agpt_sector); in find_valid_gpt()
696 * @state: disk parsed partitions
698 * Description: called from check.c, if the disk contains GPT
701 * If the first block on the disk is a legacy MBR,
718 unsigned ssz = queue_logical_block_size(state->disk->queue) / 512; in efi_partition()
735 if (!is_pte_valid(&ptes[i], last_lba(state->disk))) in efi_partition()