函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\partitions\efi.c Create Date:2022-07-27 19:07:18
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:d_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.

函数原型:static int find_valid_gpt(struct parsed_partitions *state, gpt_header **gpt, gpt_entry **ptes)

返回类型:int

参数:

类型参数名称
struct parsed_partitions *state
gpt_header **gpt
gpt_entry **ptes
586  good_pgpt等于0, good_agpt等于0, good_pmbr等于0
587  gpt_header * pgpt = NULL, * agpt = NULL
588  gpt_entry * pptes = NULL, * aptes = NULL
590  total_sectors等于NOTE: in a 32bit arch with a preemptable kernel and* an UP compile the i_size_read/write must be atomic* with respect to the local cpu (unlike with preempt disabled),* but they don't need to be atomic with respect to other cpus like in* true SMP (so they 右移9位
593  如果非ptes则返回:0
596  lastlba等于last_lba(): return number of last logical block of device*@bdev: block device* Description: Returns last LBA value on success, 0 on error.* This is stored (by sd and ide-geometry) in* the part[0] entry for this disk, and is the number of
597  如果非This allows a kernel command line option 'gpt' to override* the test for invalid PMBR. Not __initdata because reloading* the partition tables happens after init too.
599  legacymbr等于分配内存并置零
600  如果非legacymbr则转到:fail
603  ad_lba(): Read bytes from disk, starting at given LBA*@state: disk parsed partitions*@lba: the Logical Block Address of the partition table*@buffer: destination buffer*@count: bytes to read* Description: Reads @count bytes from @state->bdev into @buffer.
604  good_pmbr等于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)
605  释放内存
607  如果非good_pmbr则转到:fail
610  pr_debug("Device has a %s MBR\n", good_pmbr == GPT_MBR_PROTECTIVE ? "protective" : "hybrid")
615  good_pgpt等于s_gpt_valid() - tests one GPT header and PTEs for validity*@state: disk parsed partitions*@lba: logical block address of the GPT header to test*@gpt: GPT header ptr, filled on return.*@ptes: PTEs ptr, filled on return.
617  如果good_pgptgood_agpt等于s_gpt_valid() - tests one GPT header and PTEs for validity*@state: disk parsed partitions*@lba: logical block address of the GPT header to test*@gpt: GPT header ptr, filled on return.*@ptes: PTEs ptr, filled on return.
621  如果非good_agptThis allows a kernel command line option 'gpt' to override* the test for invalid PMBR. Not __initdata because reloading* the partition tables happens after init too.good_agpt等于s_gpt_valid() - tests one GPT header and PTEs for validity*@state: disk parsed partitions*@lba: logical block address of the GPT header to test*@gpt: GPT header ptr, filled on return.*@ptes: PTEs ptr, filled on return.
625  如果非good_pgpt且非good_agpt则转到:fail
628  mpare_gpts() - Search disk for valid GPT headers and PTEs*@pgpt: primary GPT header*@agpt: alternate GPT header*@lastlba: last LBA number* Description: Returns nothing. Sanity checks pgpt and agpt fields* and prints warnings on discrepancies.
631  如果good_pgpt
632  gpt等于pgpt
633  ptes等于pptes
634  释放内存
635  释放内存
636  如果非good_agpt打印警告信息("Alternate GPT is invalid, using primary GPT.\n")
638  返回:1
640  否则如果good_agpt
641  gpt等于agpt
642  ptes等于aptes
643  释放内存
644  释放内存
645  打印警告信息("Primary GPT is invalid, using alternate GPT.\n")
646  返回:1
649  fail :
650  释放内存
651  释放内存
652  释放内存
653  释放内存
654  * gpt = NULL
655  * ptes = NULL
656  返回:0
调用者
名称描述
efi_partition_partition(struct parsed_partitions *state)*@state: disk parsed partitions* Description: called from check.c, if the disk contains GPT* partitions, sets up partition entries in the kernel.* If the first block on the disk is a legacy MBR,