Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:ldm_parse_vblk - Read a raw VBLK object into a vblk structure*@buf: Block of data being worked on*@len: Size of the block of data*@vb: In-memory vblk in which to return information* Read a raw VBLK object into a vblk structure

Proto:static bool ldm_parse_vblk(const u8 *buf, int len, struct vblk *vb)

Type:bool

Parameter:

TypeParameterName
const u8 *buf
intlen
struct vblk *vb
1115  bool result = false
1118  BUG_ON(!buf || !vb)
1120  r_objid = ldm_relative - Calculate the next relative offset*@buffer: Block of data being worked on*@buflen: Size of the block of data*@base: Size of the previous fixed width fields*@offset: Cumulative size of the previous variable-width fields* Because many of the
1121  If r_objid < 0 Then
1122  ldm_error("VBLK header is corrupt.")
1123  Return false
1126  flags = buf[0x12]
1127  type = buf[0x13]
1128  obj_id = ldm_get_vnum - Convert a variable-width, big endian number, into cpu order*@block: Pointer to the variable-width number to convert* Large numbers in the LDM Database are often stored in a packed format. Each* number is prefixed by a one byte width marker
1129  ldm_get_vstr - Read a length-prefixed string into a buffer*@block: Pointer to the length marker*@buffer: Location to copy string to*@buflen: Size of the output buffer* Many of the strings in the LDM Database are not NULL terminated. Instead
1132  Case type == Component, version 3
1132  result = ldm_parse_cmp3 - Read a raw VBLK Component object into a vblk structure*@buffer: Block of data being worked on*@buflen: Size of the block of data*@vb: In-memory vblk in which to return information
1132  Break
1133  Case type == Disk, version 3
1133  result = ldm_parse_dsk3 - Read a raw VBLK Disk object into a vblk structure*@buffer: Block of data being worked on*@buflen: Size of the block of data*@vb: In-memory vblk in which to return information* Read a raw VBLK Disk object (version 3) into a vblk structure
1133  Break
1134  Case type == Disk, version 4
1134  result = ldm_parse_dsk4 - Read a raw VBLK Disk object into a vblk structure*@buffer: Block of data being worked on*@buflen: Size of the block of data*@vb: In-memory vblk in which to return information* Read a raw VBLK Disk object (version 4) into a vblk structure
1134  Break
1135  Case type == Disk Group, version 3
1135  result = ldm_parse_dgr3 - Read a raw VBLK Disk Group object into a vblk structure*@buffer: Block of data being worked on*@buflen: Size of the block of data*@vb: In-memory vblk in which to return information
1135  Break
1136  Case type == Disk Group, version 4
1136  result = ldm_parse_dgr4 - Read a raw VBLK Disk Group object into a vblk structure*@buffer: Block of data being worked on*@buflen: Size of the block of data*@vb: In-memory vblk in which to return information
1136  Break
1137  Case type == Partition, version 3
1137  result = ldm_parse_prt3 - Read a raw VBLK Partition object into a vblk structure*@buffer: Block of data being worked on*@buflen: Size of the block of data*@vb: In-memory vblk in which to return information
1137  Break
1138  Case type == Volume, version 5
1138  result = ldm_parse_vol5 - Read a raw VBLK Volume object into a vblk structure*@buffer: Block of data being worked on*@buflen: Size of the block of data*@vb: In-memory vblk in which to return information
1138  Break
1141  If result Then 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 VBLK 0x%llx (type: 0x%02x) ok.", (unsignedlonglong)obj_id, type)
1144  Else ldm_error("Failed to parse VBLK 0x%llx (type: 0x%02x).", (unsignedlonglong)obj_id, type)
1148  Return result
Caller
NameDescribe
ldm_ldmdb_addldm_ldmdb_add - Adds a raw VBLK entry to the ldmdb database*@data: Raw VBLK to add to the database*@len: Size of the raw VBLK*@ldb: Cache of the database structures* The VBLKs are sorted into categories. Partitions are also sorted by offset.* N