函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:generic_permission - check for access rights on a Posix-like filesystem*@inode: inode to check access rights for*@mask: right to check for (%MAY_READ, %MAY_WRITE, %MAY_EXEC,

函数原型:int generic_permission(struct inode *inode, int mask)

返回类型:int

参数:

类型参数名称
struct inode *inode
intmask
339  ret等于This does the basic permission checking
340  如果ret不等于负EACCES则返回:ret
343  如果S_ISDIR(i_mode)则
345  如果非mask按位与MAY_WRITE的值则如果apable_wrt_inode_uidgid - Check nsown_capable and uid and gid mapped*@inode: The inode in question*@cap: The capability in question* Return true if the current task has the given capability targeted at* its own user namespace and that the given inode's
348  返回:0
349  如果apable_wrt_inode_uidgid - Check nsown_capable and uid and gid mapped*@inode: The inode in question*@cap: The capability in question* Return true if the current task has the given capability targeted at* its own user namespace and that the given inode's 则返回:0
351  返回:负EACCES
357  mask与等于MAY_READ按位或MAY_WRITE按位或MAY_EXEC
358  如果mask恒等于MAY_READ则如果apable_wrt_inode_uidgid - Check nsown_capable and uid and gid mapped*@inode: The inode in question*@cap: The capability in question* Return true if the current task has the given capability targeted at* its own user namespace and that the given inode's
360  返回:0
366  如果非mask按位与MAY_EXEC的值或i_mode按位与S_IXUGO则如果apable_wrt_inode_uidgid - Check nsown_capable and uid and gid mapped*@inode: The inode in question*@cap: The capability in question* Return true if the current task has the given capability targeted at* its own user namespace and that the given inode's
368  返回:0
370  返回:负EACCES
调用者
名称描述
do_inode_permissionWe _really_ want to just do "generic_permission()" without* even looking at the inode->i_op values. So we keep a cache* flag in inode->i_opflags, that says "this has not special* permission function, use the fast case".