函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\verity\enable.c Create Date:2022-07-29 10:58:11
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:build_merkle_tree_level

函数原型:static int build_merkle_tree_level(struct inode *inode, unsigned int level, u64 num_blocks_to_hash, const struct merkle_tree_params *params, u8 *pending_hashes, struct ahash_request *req)

返回类型:int

参数:

类型参数名称
struct inode *inode
unsigned intlevel
u64num_blocks_to_hash
const struct merkle_tree_params *params
u8 *pending_hashes
struct ahash_request *req
22  vops等于s_vop
23  pending_size等于0
28  如果WARN_ON(size of data and tree blocks != PAGE_SIZE)则返回:负EINVAL
31  如果level小于umber of levels in Merkle tree
32  dst_block_num等于Starting block index for each tree level, ordered from leaf level (0)* to root level ('num_levels - 1')[level]
33  否则
34  如果WARN_ON(num_blocks_to_hash != 1)则返回:负EINVAL
36  dst_block_num等于0
39 i小于num_blocks_to_hash循环
42  如果i取模10000恒等于0或i加1恒等于num_blocks_to_hashpr_debug("Hashing block %llu of %llu for level %u\n", i + 1, num_blocks_to_hash, level)
46  如果level恒等于0则
49  如果是错误
50  err等于错误
51  fsverity_err(inode, "Error %d reading data page %llu", err, i)
54  返回:err
56  否则
60  如果是错误
69  err等于fsverity_hash_page(params, inode, req, src_page, & pending_hashes[pending_size])
71  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
72  如果err则返回:err
74  pending_size加等于same as hash_alg->digest_size
76  如果level恒等于umber of levels in Merkle tree 则返回:0
88  如果err
89  fsverity_err(inode, "Error %d writing Merkle tree block %llu", err, dst_block_num)
92  返回:err
94  dst_block_num自加
95  pending_size等于0
98  如果fatal_signal_pending(当前进程)则返回:负EINTR
100  cond_resched()
102  返回:0
调用者
名称描述
build_merkle_treeBuild the Merkle tree for the given inode using the given parameters, and* return the root hash in @root_hash.* The tree is written to a filesystem-specific location as determined by the* ->write_merkle_tree_block() method