函数逻辑报告 |
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 |
注解内核,赢得工具 | 下载SCCT | English |
函数名称: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 int | level | |
u64 | num_blocks_to_hash | |
const struct merkle_tree_params * | params | |
u8 * | pending_hashes | |
struct ahash_request * | req |
23 | pending_size等于0 |
28 | 如果WARN_ON(size of data and tree blocks != PAGE_SIZE)则返回:负EINVAL |
31 | 如果level小于umber of levels in Merkle tree 则 |
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_hash则pr_debug("Hashing block %llu of %llu for level %u\n", i + 1, num_blocks_to_hash, level) |
46 | 如果level恒等于0则 |
48 | src_page等于read_mapping_page(i_mapping, i, NULL) |
49 | 如果是错误则 |
56 | 否则 |
58 | src_page等于read_merkle_tree_page(inode, Starting block index for each tree level, ordered from leaf level (0)* to root level ('num_levels - 1')[level - 1] + i) |
60 | 如果是错误则 |
62 | fsverity_err(inode, "Error %d reading Merkle tree page %llu", err, Starting block index for each tree level, ordered from leaf level (0)* to root level ('num_levels - 1')[level - 1] + i) |
65 | 返回:err |
69 | err等于fsverity_hash_page(params, inode, req, src_page, & pending_hashes[pending_size]) |
76 | 如果level恒等于umber of levels in Merkle tree 则返回:0 |
82 | memset( & pending_hashes[pending_size], 0, size of data and tree blocks - pending_size) |
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_tree | Build 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 |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |