函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Encrypt or decrypt a single filesystem block of file contents

函数原型:int fscrypt_crypt_block(const struct inode *inode, fscrypt_direction_t rw, u64 lblk_num, struct page *src_page, struct page *dest_page, unsigned int len, unsigned int offs, gfp_t gfp_flags)

返回类型:int

参数:

类型参数名称
const struct inode *inode
fscrypt_direction_trw
u64lblk_num
struct page *src_page
struct page *dest_page
unsigned intlen
unsigned intoffs
gfp_tgfp_flags
96  struct skcipher_request * req = NULL
99  ci等于i_crypt_info
100  tfm等于The actual crypto transform used for encryption and decryption
101  res等于0
103  如果WARN_ON_ONCE(len <= 0)则返回:负EINVAL
105  如果WARN_ON_ONCE(len % ld names; don't add anything new here! != 0)则返回:负EINVAL
108  fscrypt_generate_iv( & iv, lblk_num, ci)
110  req等于skcipher_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
111  如果非req则返回:负ENOMEM
114  skcipher_request_set_callback() - set asynchronous callback function*@req: request handle*@flags: specify zero or an ORing of the flags* CRYPTO_TFM_REQ_MAY_BACKLOG the request queue may back log and* increase the wait queue beyond the initial maximum
118  初始化散列表
119  sg_set_page - Set sg entry to point at given page*@sg: SG entry*@page: The page*@len: Length of data*@offset: Offset into page* Description:* Use this function to set an sg entry pointing at a page, never assign* the page directly
120  初始化散列表
121  sg_set_page - Set sg entry to point at given page*@sg: SG entry*@page: The page*@len: Length of data*@offset: Offset into page* Description:* Use this function to set an sg entry pointing at a page, never assign* the page directly
122  skcipher_request_set_crypt() - set data buffers*@req: request handle*@src: source scatter / gather list*@dst: destination scatter / gather list*@cryptlen: number of bytes to process from @src*@iv: IV for the cipher operation which must comply with the IV
123  如果rw恒等于FS_DECRYPTres等于crypto_wait_req(rypto_skcipher_decrypt() - decrypt ciphertext*@req: reference to the skcipher_request handle that holds all information* needed to perform the cipher operation* Decrypt ciphertext data using the skcipher_request handle, & wait)
125  否则res等于crypto_wait_req(rypto_skcipher_encrypt() - encrypt plaintext*@req: reference to the skcipher_request handle that holds all information* needed to perform the cipher operation* Encrypt plaintext data using the skcipher_request handle, & wait)
127  skcipher_request_free() - zeroize and free request data structure*@req: request data structure cipher handle to be freed
128  如果res
129  fscrypt_err(inode, "%scryption failed for block %llu: %d", (rw == FS_DECRYPT ? "De" : "En"), lblk_num, res)
131  返回:res
133  返回:0
调用者
名称描述
fscrypt_encrypt_pagecache_blocksscrypt_encrypt_pagecache_blocks() - Encrypt filesystem blocks from a pagecache page*@page: The locked pagecache page containing the block(s) to encrypt*@len: Total size of the block(s) to encrypt. Must be a nonzero* multiple of the filesystem's block size.
fscrypt_encrypt_block_inplacescrypt_encrypt_block_inplace() - Encrypt a filesystem block in-place*@inode: The inode to which this block belongs*@page: The page containing the block to encrypt*@len: Size of block to encrypt. Doesn't need to be a multiple of the
fscrypt_decrypt_pagecache_blocksscrypt_decrypt_pagecache_blocks() - Decrypt filesystem blocks in a pagecache page*@page: The locked pagecache page containing the block(s) to decrypt*@len: Total size of the block(s) to decrypt. Must be a nonzero* multiple of the filesystem's block size.
fscrypt_decrypt_block_inplacescrypt_decrypt_block_inplace() - Decrypt a filesystem block in-place*@inode: The inode to which this block belongs*@page: The page containing the block to decrypt*@len: Size of block to decrypt. Doesn't need to be a multiple of the
fscrypt_zeroout_range