| Function report | 
| Source Code: fs\crypto\keysetup.c | Create Date:2022-07-28 20:24:01 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:fscrypt_get_encryption_info
Proto:int fscrypt_get_encryption_info(struct inode *inode)
Type:int
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| struct inode * | inode | 
| 362 | struct key * master_key = NULL | 
| 365 | If fscrypt_has_encryption_key(inode) Then Return 0 | 
| 372 | res = get_context(inode, & ctx, size of ctx ) | 
| 373 | If res < 0 Then | 
| 374 | If Not fscrypt_dummy_context_enabled(inode) || IS_ENCRYPTED(inode) Then | 
| 376 | fscrypt_warn(inode, "Error %d getting encryption context", res) | 
| 379 | Return res | 
| 383 | version = FSCRYPT_CONTEXT_V1 | 
| 386 | memset(master_key_descriptor, 0x42, FSCRYPT_KEY_DESCRIPTOR_SIZE) | 
| 391 | crypt_info = Shortcuts | 
| 392 | If Not crypt_info Then Return -ENOMEM | 
| 397 | res = fscrypt_policy_from_context( & The encryption policy used by this inode , & ctx, res) | 
| 398 | If res Then | 
| 399 | fscrypt_warn(inode, "Unrecognized or corrupt encryption context") | 
| 401 | Go to out | 
| 405 | Case version == FSCRYPT_CONTEXT_V1 | 
| 406 | memcpy(This inode's nonce, copied from the fscrypt_context , nonce, FS_KEY_DERIVATION_NONCE_SIZE) | 
| 408 | Break | 
| 409 | Case version == FSCRYPT_CONTEXT_V2 | 
| 410 | memcpy(This inode's nonce, copied from the fscrypt_context , nonce, FS_KEY_DERIVATION_NONCE_SIZE) | 
| 412 | Break | 
| 413 | Default | 
| 419 | If Not fscrypt_supported_policy( & The encryption policy used by this inode , inode) Then | 
| 429 | WARN_ON(ivsize > FSCRYPT_MAX_IV_SIZE) | 
| 430 | Encryption mode used for this inode. It corresponds to either the* contents or filenames encryption mode, depending on the inode type. = mode | 
| 436 | If (cmpxchg_release( & i_crypt_info, NULL, crypt_info) == NULL) Then | 
| 437 | If master_key Then | 
| 443 | spin_lock( & mk_decrypted_inodes_lock) | 
| 446 | spin_unlock( & mk_decrypted_inodes_lock) | 
| 448 | crypt_info = NULL | 
| 450 | res = 0 | 
| 451 | out : | 
| 452 | If master_key Then | 
| 460 | put_crypt_info(crypt_info) | 
| 461 | Return res | 
| Name | Describe | 
|---|---|
| fscrypt_setup_filename | scrypt_setup_filename() - prepare to search a possibly encrypted directory*@dir: the directory that will be searched*@iname: the user-provided filename being searched for*@lookup: 1 if we're allowed to proceed without the key because it's* ->lookup() or | 
| __fscrypt_prepare_symlink | |
| fscrypt_get_symlink | scrypt_get_symlink - get the target of an encrypted symlink*@inode: the symlink inode*@caddr: the on-disk contents of the symlink*@max_size: size of @caddr buffer*@done: if successful, will be set up to free the returned target if needed | 
| fscrypt_has_permitted_context | scrypt_has_permitted_context() - is a file's encryption policy permitted* within its directory?*@parent: inode for parent directory*@child: inode for file being looked up, opened, or linked into @parent* Filesystems must call this before permitting access | 
| fscrypt_inherit_context | scrypt_inherit_context() - Sets a child context from its parent*@parent: Parent inode from which the context is inherited | 
| fscrypt_require_key | scrypt_require_key - require an inode's encryption key*@inode: the inode we need the key for* If the inode is encrypted, set up its encryption key if not already done | 
| fscrypt_d_revalidate | Validate dentries in encrypted directories to make sure we aren't potentially* caching stale dentries after a key has been added. | 
| 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 |