函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

函数原型:static int build_merkle_tree(struct inode *inode, const struct merkle_tree_params *params, u8 *root_hash)

返回类型:int

参数:

类型参数名称
struct inode *inode
const struct merkle_tree_params *params
u8 *root_hash
121  err等于负ENOMEM
123  如果i_size恒等于0则
125  memset(root_hash, 0, same as hash_alg->digest_size )
126  返回:0
129  pending_hashes等于开辟内存
130  req等于ahash_request_alloc() - allocate request data structure*@tfm: cipher handle to be registered with the request*@gfp: memory allocation flag that is handed to kmalloc by the API call.* Allocate the request data structure that must be used with the ahash
131  如果非pending_hashes或非req则转到:out
139  blocks等于i_sizesize of data and tree blocks 减1右移log2(block_size)
141 level小于等于umber of levels in Merkle tree 循环
142  err等于build_merkle_tree_level(inode, level, blocks, params, pending_hashes, req)
144  如果err则转到:out
146  blocks等于blocksumber of hashes per tree block 减1右移log2(hashes_per_block)
149  memcpy(root_hash, pending_hashes, same as hash_alg->digest_size )
150  err等于0
151  out :
152  释放内存
153  归零并释放数据结构请求
154  返回:err
调用者
名称描述
enable_verity