函数逻辑报告 |
Source Code:block\partitions\efi.c |
Create Date:2022-07-27 19:07:03 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称: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.
函数原型:static int is_gpt_valid(struct parsed_partitions *state, u64 lba, gpt_header **gpt, gpt_entry **ptes)
返回类型:int
参数:
类型 | 参数 | 名称 |
---|---|---|
struct parsed_partitions * | state | |
u64 | lba | |
gpt_header ** | gpt | |
gpt_entry ** | ptes |
343 | 如果非ptes则返回:0 |
349 | 如果le64_to_cpu(signature)不等于GPT_HEADER_SIGNATURE则 |
350 | pr_debug("GUID Partition Table Header signature is wrong:%lld != %lld\n", (unsignedlonglong)le64_to_cpu(signature), (unsignedlonglong)GPT_HEADER_SIGNATURE) |
354 | 转到:fail |
358 | 如果le32_to_cpu(header_size)大于bdev_logical_block_size(bdev)则 |
360 | pr_debug("GUID Partition Table Header size is too large: %u > %u\n", le32_to_cpu(header_size), bdev_logical_block_size(bdev)) |
363 | 转到:fail |
367 | 如果le32_to_cpu(header_size)小于sizeof(gpt_header)则 |
368 | pr_debug("GUID Partition Table Header size is too small: %u < %zu\n", le32_to_cpu(header_size), sizeof(gpt_header)) |
371 | 转到:fail |
375 | origcrc等于le32_to_cpu(header_crc32) |
376 | header_crc32等于0 |
384 | header_crc32等于cpu_to_le32(origcrc) |
388 | 如果le64_to_cpu(my_lba)不等于lba则 |
389 | pr_debug("GPT my_lba incorrect: %lld != %lld\n", (unsignedlonglong)le64_to_cpu(my_lba), (unsignedlonglong)lba) |
392 | 转到:fail |
399 | 如果le64_to_cpu(first_usable_lba)大于lastlba则 |
400 | pr_debug("GPT: first_usable_lba incorrect: %lld > %lld\n", (unsignedlonglong)le64_to_cpu(first_usable_lba), (unsignedlonglong)lastlba) |
403 | 转到:fail |
405 | 如果le64_to_cpu(last_usable_lba)大于lastlba则 |
406 | pr_debug("GPT: last_usable_lba incorrect: %lld > %lld\n", (unsignedlonglong)le64_to_cpu(last_usable_lba), (unsignedlonglong)lastlba) |
409 | 转到:fail |
412 | pr_debug("GPT: last_usable_lba incorrect: %lld > %lld\n", (unsignedlonglong)le64_to_cpu(last_usable_lba), (unsignedlonglong)le64_to_cpu(first_usable_lba)) |
415 | 转到:fail |
418 | 如果le32_to_cpu(sizeof_partition_entry)不等于sizeof(gpt_entry)则 |
426 | 如果pt_size大于Maximum allocatable size 则 |
427 | pr_debug("GUID Partition Table is too large: %llu > %lu bytes\n", (unsignedlonglong)pt_size, Maximum allocatable size ) |
429 | 转到:fail |
432 | 如果非ptes等于alloc_read_gpt_entries(): reads partition entries from disk*@state: disk parsed partitions*@gpt: GPT header* Description: Returns ptes on success, NULL on error则转到:fail |
438 | 如果crc不等于le32_to_cpu(partition_entry_array_crc32)则 |
444 | 返回:1 |
446 | fail_ptes : |
447 | 释放内存 |
448 | * ptes = NULL |
449 | fail : |
450 | 释放内存 |
451 | * gpt = NULL |
452 | 返回:0 |
名称 | 描述 |
---|---|
find_valid_gpt | 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. |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |