函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:may_open

函数原型:static int may_open(const struct path *path, int acc_mode, int flag)

返回类型:int

参数:

类型参数名称
const struct path *path
intacc_mode
intflag
2892  dentry等于dentry
2893  inode等于 Where the name belongs to - NULL is * negative
2896  如果非inode则返回:负ENOENT
2900  : & == S_IFLNK
2901  返回:负ELOOP
2902  : & == S_IFDIR
2903  如果acc_mode按位与MAY_WRITE则返回:负EISDIR
2905  退出
2906  : & == S_IFBLK
2907  : & == S_IFCHR
2908  如果非may_open_dev(path)则返回:负EACCES
2911  : & == S_IFIFO
2912  : & == S_IFSOCK
2913  flag与等于O_TRUNC的反
2914  退出
2917  error等于de_permission - Check for access rights to a given inode*@inode: Inode to check permission on*@mask: Right to check for (%MAY_READ, %MAY_WRITE, %MAY_EXEC)* Check for read/write/execute permissions on an inode
2918  如果error则返回:error
2924  如果IS_APPEND(inode)则
2925  如果flag按位与O_ACCMODE的值不等于O_RDONLY且非flag按位与O_APPEND的值则返回:负EPERM
2927  如果flag按位与O_TRUNC则返回:负EPERM
2932  如果flag按位与O_NOATIME且非inode_owner_or_capable(inode)则返回:负EPERM
2935  返回:0
调用者
名称描述
atomic_openAttempt to atomically look up, create and open a file from a negative* dentry
do_lastHandle the last step of open()
do_tmpfile