Function report |
Source Code:fs\verity\enable.c |
Create Date:2022-07-28 20:24:31 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:build_merkle_tree_level
Proto: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)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
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 | If WARN_ON(size of data and tree blocks != PAGE_SIZE) Then Return -EINVAL |
31 | If level < umber of levels in Merkle tree Then |
33 | Else |
34 | If WARN_ON(num_blocks_to_hash != 1) Then Return -EINVAL |
36 | dst_block_num = 0 |
39 | When i < num_blocks_to_hash cycle |
42 | If i % 10000 == 0 || i + 1 == num_blocks_to_hash Then pr_debug("Hashing block %llu of %llu for level %u\n", i + 1, num_blocks_to_hash, level) |
46 | If level == 0 Then |
48 | src_page = read_mapping_page(i_mapping, i, NULL) |
56 | Else |
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) |
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 | Return err |
69 | err = fsverity_hash_page(params, inode, req, src_page, & pending_hashes[pending_size]) |
76 | If level == umber of levels in Merkle tree Then Return 0 |
79 | If pending_size + same as hash_alg->digest_size > size of data and tree blocks || i + 1 == num_blocks_to_hash Then |
82 | memset( & pending_hashes[pending_size], 0, size of data and tree blocks - pending_size) |
88 | If err Then |
89 | fsverity_err(inode, "Error %d writing Merkle tree block %llu", err, dst_block_num) |
92 | Return err |
94 | dst_block_num++ |
95 | pending_size = 0 |
98 | If fatal_signal_pending(current process) Then Return -EINTR |
100 | cond_resched() |
102 | Return 0 |
Name | Describe |
---|---|
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 |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |