Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:ldm_parse_tocblock - Read the LDM Database TOCBLOCK structure*@data: Raw database TOCBLOCK structure loaded from the device*@toc: In-memory toc structure in which to return parsed information* This parses the LDM Database TOCBLOCK (table of contents)

Proto:static bool ldm_parse_tocblock(const u8 *data, struct tocblock *toc)

Type:bool

Parameter:

TypeParameterName
const u8 *data
struct tocblock *toc
128  BUG_ON(!data || !toc)
130  If TOCBLOCK != get_unaligned_be64(data) Then
131  ldm_crit("Cannot find TOCBLOCK, database may be corrupt.")
132  Return false
134  strncpy( We have exactly two bitmaps. , data + 0x24, size of We have exactly two bitmaps. )
135  We have exactly two bitmaps. [ size of We have exactly two bitmaps. - 1] = 0
136  bitmap1_start = get_unaligned_be64(data + 0x2E)
137  bitmap1_size = get_unaligned_be64(data + 0x36)
139  If strncmp( We have exactly two bitmaps. , Names of the two defined , size of We have exactly two bitmaps. ) != 0 Then
141  ldm_crit("TOCBLOCK's first bitmap is '%s', should be '%s'.", Names of the two defined , We have exactly two bitmaps. )
143  Return false
145  strncpy(bitmap2_name, data + 0x46, size of bitmap2_name )
146  bitmap2_name[ size of bitmap2_name - 1] = 0
147  bitmap2_start = get_unaligned_be64(data + 0x50)
148  bitmap2_size = get_unaligned_be64(data + 0x58)
149  If strncmp(bitmap2_name, maps in the TOCBLOCK. , size of bitmap2_name ) != 0 Then
151  ldm_crit("TOCBLOCK's second bitmap is '%s', should be '%s'.", maps in the TOCBLOCK. , bitmap2_name)
153  Return false
155  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 TOCBLOCK successfully.")
156  Return true
Caller
NameDescribe
ldm_validate_tocblocksldm_validate_tocblocks - Validate the table of contents and its backups*@state: Partition check state including device holding the LDM Database*@base: Offset, into @state->bdev, of the database*@ldb: Cache of the database structures* Find and compare the