函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

函数原型:static bool ldm_validate_tocblocks(struct parsed_partitions *state, unsigned long base, struct ldmdb *ldb)

返回类型:bool

参数:

类型参数名称
struct parsed_partitions *state
unsigned longbase
struct ldmdb *ldb
356  static const int off[4] = {Tables of contents. , OFF_TOCB2, OFF_TOCB3, OFF_TOCB4}
362  bool result = false
364  BUG_ON(!state || !ldb)
365  ph等于 Cache of the database
366  tb[0]等于toc
367  tb[1]等于分配数组内存
368  如果非tb[1]则
369  ldm_crit("Out of memory.")
370  转到:err
372  tb[2]等于tb[1]加tb[1]的长度
373  tb[3]等于tb[2]加tb[2]的长度
380 i小于4循环
381  data等于read_part_sector(state, base + off[i], & sect)
382  如果非data
383  ldm_error("Disk read failed for TOCBLOCK %d.", i)
384  继续下一循环
386  如果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) nr_tbs自加
388  put_dev_sector(sect)
390  如果非nr_tbs
391  ldm_crit("Failed to find a valid TOCBLOCK.")
392  转到:err
395  如果bitmap1_startbitmap1_size大于config_sizebitmap2_startbitmap2_size大于config_size
398  ldm_crit("The bitmaps are out of range. Giving up.")
399  转到:err
402 i小于nr_tbs循环
404  ldm_crit("TOCBLOCKs 0 and %d do not match.", i)
405  转到:err
408  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("Validated %d TOCBLOCKs successfully.", nr_tbs)
409  result = true
410  err :
411  释放内存
412  返回:result
调用者
名称描述
ldm_partitionldm_partition - Find out whether a device is a dynamic disk and handle it*@state: Partition check state including device holding the LDM Database* This determines whether the device @bdev is a dynamic disk and if so creates