Function report |
Source Code:block\partitions\ldm.c |
Create Date:2022-07-28 17:27:16 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name: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
Proto:static bool ldm_parse_privhead(const u8 *data, struct privhead *ph)
Type:bool
Parameter:
Type | Parameter | Name |
---|---|---|
const u8 * | data | |
struct privhead * | ph |
69 | bool is_vista = false |
72 | If PRIVHEAD != get_unaligned_be64(data) Then |
73 | ldm_error("Cannot find PRIVHEAD structure. LDM database is corrupt. Aborting.") |
75 | Return 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 | If Offsets and sizes are in sectors. == 2 && ver_minor == 12 Then is_vista = true |
86 | If Not is_vista && ( Offsets and sizes are in sectors. != 2 || ver_minor != 11 ) Then |
87 | ldm_error("Expected PRIVHEAD version 2.11 or 2.12, got %d.%d. Aborting.", Offsets and sizes are in sectors. , ver_minor) |
89 | Return false |
93 | If config_size != Size in sectors (= 1MiB). Then |
95 | ldm_info("Database is normally %u bytes, it claims to be %llu bytes.", Size in sectors (= 1MiB). , (unsignedlonglong)config_size) |
99 | If logical_disk_size == 0 || logical_disk_start + logical_disk_size > config_start Then |
101 | ldm_error("PRIVHEAD disk size doesn't match real disk size") |
102 | Return false |
104 | If uuid_parse(data + 0x0030, & disk_id) Then |
105 | ldm_error("PRIVHEAD contains an invalid GUID.") |
106 | Return false |
109 | Return true |
Name | Describe |
---|---|
ldm_validate_privheads | ldm_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 |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |