Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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

Proto:static bool ldm_parse_vol5(const u8 *buffer, int buflen, struct vblk *vb)

Type:bool

Parameter:

TypeParameterName
const u8 *buffer
intbuflen
struct vblk *vb
1010  BUG_ON(!buffer || !vb)
1011  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
1012  If r_objid < 0 Then
1013  ldm_error("r_objid %d < 0", r_objid)
1014  Return false
1016  r_name = 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
1017  If r_name < 0 Then
1018  ldm_error("r_name %d < 0", r_name)
1019  Return false
1021  r_vtype = 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
1022  If r_vtype < 0 Then
1023  ldm_error("r_vtype %d < 0", r_vtype)
1024  Return false
1026  r_disable_drive_letter = 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
1027  If r_disable_drive_letter < 0 Then
1028  ldm_error("r_disable_drive_letter %d < 0", r_disable_drive_letter)
1030  Return false
1032  r_child = 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
1033  If r_child < 0 Then
1034  ldm_error("r_child %d < 0", r_child)
1035  Return false
1037  r_size = 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
1038  If r_size < 0 Then
1039  ldm_error("r_size %d < 0", r_size)
1040  Return false
1042  If buffer[0x12] & VBLK_FLAG_VOLU_ID1 Then
1043  r_id1 = 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
1044  If r_id1 < 0 Then
1045  ldm_error("r_id1 %d < 0", r_id1)
1046  Return false
1048  Else r_id1 = r_size
1050  If buffer[0x12] & VBLK_FLAG_VOLU_ID2 Then
1051  r_id2 = 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
1052  If r_id2 < 0 Then
1053  ldm_error("r_id2 %d < 0", r_id2)
1054  Return false
1056  Else r_id2 = r_id1
1058  If buffer[0x12] & VBLK_FLAG_VOLU_SIZE Then
1059  r_size2 = 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
1060  If r_size2 < 0 Then
1061  ldm_error("r_size2 %d < 0", r_size2)
1062  Return false
1064  Else r_size2 = r_id2
1066  If buffer[0x12] & VBLK_FLAG_VOLU_DRIVE Then
1067  r_drive = 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
1068  If r_drive < 0 Then
1069  ldm_error("r_drive %d < 0", r_drive)
1070  Return false
1072  Else r_drive = r_size2
1074  len = r_drive
1075  If len < 0 Then
1076  ldm_error("len %d < 0", len)
1077  Return false
1079  len += VBLK_SIZE_VOL5
1080  If len > get_unaligned_be32(buffer + 0x14) Then
1081  ldm_error("len %d > BE32(buffer + 0x14) %d", len, get_unaligned_be32(buffer + 0x14))
1083  Return false
1085  volu = volu
1086  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
1088  memcpy(volume_state, buffer + 0x18 + r_disable_drive_letter, size of volume_state )
1090  size = 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
1091  partition_type = buffer[0x41 + r_size]
1092  memcpy(guid, buffer + 0x42 + r_size, size of guid )
1093  If buffer[0x12] & VBLK_FLAG_VOLU_DRIVE Then
1094  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
1097  Return true
Caller
NameDescribe
ldm_parse_vblkldm_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