函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:setattr_prepare - check if attribute changes to a dentry are allowed*@dentry: dentry to check*@attr: attributes to change* Check if we are allowed to change the attributes contained in @attr* in the given dentry

函数原型:int setattr_prepare(struct dentry *dentry, struct iattr *attr)

返回类型:int

参数:

类型参数名称
struct dentry *dentry
struct iattr *attr
63  inode等于获得目录项的索引节点
64  ia_valid等于ia_valid
70  如果ia_valid按位与ATTR_SIZE
71  error等于de_newsize_ok - may this inode be truncated to a given size*@inode: the inode to be truncated*@offset: the new size to assign to the inode* inode_newsize_ok must be called with i_mutex held
72  如果error则返回:error
77  如果ia_valid按位与Not a change, but a change it 则转到:kill_priv
81  如果ia_valid按位与ATTR_UID且非chown_ok(inode, ia_uid)则返回:负EPERM
85  如果ia_valid按位与ATTR_GID且非chgrp_ok(inode, ia_gid)则返回:负EPERM
89  如果ia_valid按位与Attribute flags. These should be or-ed together to figure out what* has been changed!
90  如果非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.则返回:负EPERM
93  如果非Check whether we're fsgid/egid or in the supplemental group..且非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 ia_mode与等于S_ISGID的反
100  如果ia_valid按位与ATTR_MTIME_SET按位或ATTR_ATIME_SET按位或ATTR_TIMES_SET的值则
101  如果非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.则返回:负EPERM
105  kill_priv :
107  如果ia_valid按位与ATTR_KILL_PRIV
110  error等于security_inode_killpriv(dentry)
111  如果error则返回:error
115  返回:0
调用者
名称描述
simple_setattrsimple_setattr - setattr for simple filesystem*@dentry: dentry*@iattr: iattr structure* Returns 0 on success, -error on failure
ramfs_nommu_setattrhandle a change of attributes* - we're specifically interested in a change of size