Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:scrypt_fname_disk_to_usr() - converts a filename from disk space to user* space* The caller must have allocated sufficient memory for the @oname string.* If the key is available, we'll decrypt the disk name; otherwise, we'll encode* it for presentation

Proto:int fscrypt_fname_disk_to_usr(struct inode *inode, unsigned int hash, unsigned int minor_hash, const struct fscrypt_str *iname, struct fscrypt_str *oname)

Type:int

Parameter:

TypeParameterName
struct inode *inode
unsigned inthash
unsigned intminor_hash
const struct fscrypt_str *iname
struct fscrypt_str *oname
255  qname = FSTR_TO_QSTR(iname)
258  If fscrypt_is_dot_dotdot( & qname) Then
259  name[0] = '.'
260  name[len - 1] = '.'
261  len = len
262  Return 0
265  If len < ld names; don't add anything new here! Then Return -EUCLEAN
268  If fscrypt_has_encryption_key(inode) Then Return ame_decrypt() - decrypt a filename* The caller must have allocated sufficient memory for the @oname string.* Return: 0 on success, -errno on failure
271  If len <= FSCRYPT_FNAME_MAX_UNDIGESTED_SIZE Then
272  len = ase64_encode() -* Encodes the input string using characters from the set [A-Za-z0-9+,].* The encoded string is roughly 4/3 times the size of the input string.* Return: length of the encoded string
274  Return 0
276  If hash Then
277  hash = hash
278  minor_hash = minor_hash
279  Else
280  hash = 0
281  minor_hash = 0
283  memcpy(digest, FSCRYPT_FNAME_DIGEST(name, len), FSCRYPT_FNAME_DIGEST_SIZE)
286  name[0] = '_'
287  len = 1 + ase64_encode() -* Encodes the input string using characters from the set [A-Za-z0-9+,].* The encoded string is roughly 4/3 times the size of the input string.* Return: length of the encoded string
289  Return 0
Caller
NameDescribe
fscrypt_get_symlinkscrypt_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