函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:ldm_parse_privhead - Read the LDM Database PRIVHEAD structure*@data: Raw database PRIVHEAD structure loaded from the device*@ph: In-memory privhead structure in which to return parsed information* This parses the LDM database PRIVHEAD structure supplied

函数原型:static bool ldm_parse_privhead(const u8 *data, struct privhead *ph)

返回类型:bool

参数:

类型参数名称
const u8 *data
struct privhead *ph
69  bool is_vista = false
71  BUG_ON(!data || !ph)
72  如果PRIVHEAD 不等于get_unaligned_be64(data)则
73  ldm_error("Cannot find PRIVHEAD structure. LDM database is corrupt. Aborting.")
75  返回:false
77  Offsets and sizes are in sectors. 等于get_unaligned_be16(data + 0x000C)
78  ver_minor等于get_unaligned_be16(data + 0x000E)
79  logical_disk_start等于get_unaligned_be64(data + 0x011B)
80  logical_disk_size等于get_unaligned_be64(data + 0x0123)
81  config_start等于get_unaligned_be64(data + 0x012B)
82  config_size等于get_unaligned_be64(data + 0x0133)
84  如果Offsets and sizes are in sectors. 恒等于2且ver_minor恒等于12则is_vista = true
86  如果非is_vistaOffsets and sizes are in sectors. 不等于2或ver_minor不等于11的值则
87  ldm_error("Expected PRIVHEAD version 2.11 or 2.12, got %d.%d. Aborting.", Offsets and sizes are in sectors. , ver_minor)
89  返回:false
91  ldm_debug/info/error/crit - Output an error message*@f: A printf format string containing the message*@...: Variables to substitute into @f* ldm_debug() writes a DEBUG level message to the syslog but only if the* driver was compiled with debug enabled("PRIVHEAD version %d.%d (Windows %s).", Offsets and sizes are in sectors. , ver_minor, is_vista ? "Vista" : "2000/XP")
93  如果config_size不等于Size in sectors (= 1MiB).
95  ldm_info("Database is normally %u bytes, it claims to be %llu bytes.", Size in sectors (= 1MiB). , (unsignedlonglong)config_size)
99  如果logical_disk_size恒等于0或logical_disk_startlogical_disk_size大于config_start
101  ldm_error("PRIVHEAD disk size doesn't match real disk size")
102  返回:false
104  如果uuid_parse(data + 0x0030, & disk_id)则
105  ldm_error("PRIVHEAD contains an invalid GUID.")
106  返回:false
108  ldm_debug/info/error/crit - Output an error message*@f: A printf format string containing the message*@...: Variables to substitute into @f* ldm_debug() writes a DEBUG level message to the syslog but only if the* driver was compiled with debug enabled("Parsed PRIVHEAD successfully.")
109  返回:true
调用者
名称描述
ldm_validate_privheadsldm_validate_privheads - Compare the primary privhead with its backups*@state: Partition check state including device holding the LDM Database*@ph1: Memory struct to fill with ph contents* Read and compare all three privheads from disk