函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:fscrypt_ioctl_set_policy

函数原型:int fscrypt_ioctl_set_policy(struct file *filp, const void __user *arg)

返回类型:int

参数:

类型参数名称
struct file *filp
const void __user *arg
316  inode等于file_inode(filp)
321  如果Careful: we have to cast the result to the type of the pointer* for sign reasons(version, (constu8__user * )arg)则返回:负EFAULT
324  size等于Return the size expected for the given fscrypt_policy based on its version* number, or 0 if the policy version is unrecognized.
325  如果size小于等于0则返回:负EINVAL
339  version等于version
340  如果copy_from_user( & policy, arg, size)则返回:负EFAULT
342  version等于version
344  如果非de_owner_or_capable - check current task permissions to inode*@inode: inode being checked* Return true if current either has CAP_FOWNER in a namespace with the* inode owner uid mapped, or owns the file.则返回:负EACCES
347  ret等于mnt_want_write_file - get write access to a file's mount*@file: the file who's mount on which to take a write* This is like mnt_want_write, but it takes a file and can* do some optimisations if the file is open for write already
348  如果ret则返回:ret
351  inode_lock(inode)
353  ret等于fscrypt_get_policy(inode, & existing_policy)
354  如果ret恒等于负ENODATA
355  如果非S_ISDIR(i_mode)则ret等于负ENOTDIR
357  否则如果IS_DEADDIR(inode)则ret等于负ENOENT
359  否则如果非empty_dir(inode)则ret等于负ENOTEMPTY
361  否则ret等于set_encryption_policy(inode, & policy)
363  否则如果ret恒等于负EINVALret恒等于0且非scrypt_policies_equal - check whether two encryption policies are the same* Return: %true if equal, else %false
367  ret等于负EEXIST
370  inode_unlock(inode)
372  mnt_drop_write_file(filp)
373  返回:ret