Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

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

Type:bool

Parameter:

TypeParameterName
const u8 *buffer
intbuflen
struct vblk *vb
933  BUG_ON(!buffer || !vb)
934  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
935  If r_objid < 0 Then
936  ldm_error("r_objid %d < 0", r_objid)
937  Return false
939  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
940  If r_name < 0 Then
941  ldm_error("r_name %d < 0", r_name)
942  Return false
944  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
945  If r_size < 0 Then
946  ldm_error("r_size %d < 0", r_size)
947  Return false
949  r_parent = 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
950  If r_parent < 0 Then
951  ldm_error("r_parent %d < 0", r_parent)
952  Return false
954  r_diskid = 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
955  If r_diskid < 0 Then
956  ldm_error("r_diskid %d < 0", r_diskid)
957  Return false
959  If buffer[0x12] & VBLK_FLAG_PART_INDEX Then
960  r_index = 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
961  If r_index < 0 Then
962  ldm_error("r_index %d < 0", r_index)
963  Return false
965  len = r_index
966  Else
967  r_index = 0
968  len = r_diskid
970  If len < 0 Then
971  ldm_error("len %d < 0", len)
972  Return false
974  len += VBLK_SIZE_PRT3
975  If len > get_unaligned_be32(buffer + 0x14) Then
976  ldm_error("len %d > BE32(buffer + 0x14) %d", len, get_unaligned_be32(buffer + 0x14))
978  Return false
980  part = part
981  VBLK Partition = get_unaligned_be64(buffer + 0x24 + r_name)
982  volume_offset = get_unaligned_be64(buffer + 0x2C + r_name)
983  start, size and vol_off in sectors = 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
984  parent_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
985  disk_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
986  If flags & VBLK_FLAG_PART_INDEX Then partnum = buffer[0x35 + r_diskid]
988  Else partnum = 0
990  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