Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\crypto\hooks.c Create Date:2022-07-28 20:23:46
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:__fscrypt_encrypt_symlink

Proto:int __fscrypt_encrypt_symlink(struct inode *inode, const char *target, unsigned int len, struct fscrypt_str *disk_link)

Type:int

Parameter:

TypeParameterName
struct inode *inode
const char *target
unsigned intlen
struct fscrypt_str *disk_link
172  iname = QSTR_INIT(target, len)
176  err = 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
177  If err Then Return err
180  If name Then
182  sd = name
183  Else
184  sd = Allocation memory
185  If Not sd Then Return -ENOMEM
188  ciphertext_len = len - size of sd
189  len = cpu_to_le16(ciphertext_len)
191  err = ame_encrypt() - encrypt a filename* The output buffer must be at least as large as the input buffer.* Any extra space is filled with NUL padding before encryption.* Return: 0 on success, -errno on failure
192  If err Then Go to err_free_sd
200  encrypted_path[ciphertext_len] = '\0'
203  err = -ENOMEM
204  i_link = kmemdup - duplicate region of memory*@src: memory region to duplicate*@len: memory region length*@gfp: GFP mask to use* Return: newly allocated copy of @src or %NULL in case of error
205  If Not i_link Then Go to err_free_sd
208  If Not name Then name = sd
210  Return 0
212  err_free_sd :
213  If Not name Then kfree(sd)
215  Return err
Caller
NameDescribe
fscrypt_encrypt_symlinkscrypt_encrypt_symlink - encrypt the symlink target if needed*@inode: symlink inode*@target: plaintext symlink target*@len: length of @target excluding null terminator*@disk_link: (in/out) the on-disk symlink target being prepared* If the symlink target