函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\partitions\ldm.c Create Date:2022-07-27 19:03:38
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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

函数原型:static bool ldm_parse_prt3(const u8 *buffer, int buflen, struct vblk *vb)

返回类型:bool

参数:

类型参数名称
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  如果r_objid小于0则
936  ldm_error("r_objid %d < 0", r_objid)
937  返回: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  如果r_name小于0则
941  ldm_error("r_name %d < 0", r_name)
942  返回: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  如果r_size小于0则
946  ldm_error("r_size %d < 0", r_size)
947  返回: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  如果r_parent小于0则
951  ldm_error("r_parent %d < 0", r_parent)
952  返回: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  如果r_diskid小于0则
956  ldm_error("r_diskid %d < 0", r_diskid)
957  返回:false
959  如果buffer[0x12]按位与VBLK_FLAG_PART_INDEX
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  如果r_index小于0则
962  ldm_error("r_index %d < 0", r_index)
963  返回:false
965  len等于r_index
966  否则
967  r_index等于0
968  len等于r_diskid
970  如果len小于0则
971  ldm_error("len %d < 0", len)
972  返回:false
974  len加等于VBLK_SIZE_PRT3
975  如果len大于get_unaligned_be32(buffer + 0x14)则
976  ldm_error("len %d > BE32(buffer + 0x14) %d", len, get_unaligned_be32(buffer + 0x14))
978  返回: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  如果flags按位与VBLK_FLAG_PART_INDEXpartnum等于buffer[0x35 + r_diskid]
988  否则partnum等于0
990  返回:true
调用者
名称描述
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