Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\partitions\efi.c Create Date:2022-07-28 17:31:20
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:s_pmbr_valid(): test Protective MBR for validity*@mbr: pointer to a legacy mbr structure*@total_sectors: amount of sectors in the device* Description: Checks for a valid protective or hybrid* master boot record (MBR)

Proto:static int is_pmbr_valid(legacy_mbr *mbr, sector_t total_sectors)

Type:int

Parameter:

TypeParameterName
legacy_mbr *mbr
sector_ttotal_sectors
176  sz = 0
177  part = 0 , ret = 0
179  If Not mbr || le16_to_cpu(signature) != MSDOS_MBR_SIGNATURE Then Go to done
182  When i < 4 cycle
183  ret = pmbr_part_valid( & partition_record[i])
184  If ret == GPT_MBR_PROTECTIVE Then
185  part = i
191  Go to check_hybrid
195  If ret != GPT_MBR_PROTECTIVE Then Go to done
197  check_hybrid :
198  When i < 4 cycle If EFI and legacy non-EFI OS types != EFI_PMBR_OSTYPE_EFI_GPT && EFI and legacy non-EFI OS types != 0x00 Then
202  ret = GPT_MBR_HYBRID
216  If ret == GPT_MBR_PROTECTIVE Then
217  sz = le32_to_cpu( used by EFI - size of pt in LBA )
218  If sz != total_sectors - 1 && sz != 0xFFFFFFFF Then pr_debug("GPT: mbr size in lba (%u) different than whole disk (%u).\n", sz, min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(uint32_t, total_sectors - 1, 0xFFFFFFFF))
223  done :
224  Return ret
Caller
NameDescribe
find_valid_gptd_valid_gpt() - Search disk for valid GPT headers and PTEs*@state: disk parsed partitions*@gpt: GPT header ptr, filled on return.*@ptes: PTEs ptr, filled on return.* Description: Returns 1 if valid, 0 on error.