函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\inode.c Create Date:2022-07-27 20:14:43
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:securityfs_create_dentry - create a dentry in the securityfs filesystem*@name: a pointer to a string containing the name of the file to create.*@mode: the permission that the file should have*@parent: a pointer to the parent dentry for this file

函数原型:static struct dentry *securityfs_create_dentry(const char *name, umode_t mode, struct dentry *parent, void *data, const struct file_operations *fops, const struct inode_operations *iops)

返回类型:struct dentry

参数:

类型参数名称
const char *name
umode_tmode
struct dentry *parent
void *data
const struct file_operations *fops
const struct inode_operations *iops
116  如果非mode按位与S_IFMT的值则mode等于mode按位与S_IALLUGO按位或S_IFREG
119  pr_debug("securityfs: creating file '%s'\n", name)
121  error等于simple_pin_fs( & fs_type, & mount, & mount_count)
122  如果error则返回:错误号
125  如果非parentparent等于 root of the mounted tree
128  dir等于获得目录项的索引节点
130  inode_lock(dir)
131  dentry等于lookup_one_len(name, parent, strlen - Find the length of a string*@s: The string to be sized)
132  如果是错误则转到:out
135  如果d_really_is_positive - Determine if a dentry is really positive (ignoring fallthroughs)*@dentry: The dentry in question* Returns true if the dentry represents a name that maps to an inode* (ie
136  error等于负EEXIST
137  转到:out1
140  inode等于取新的索引节点
141  如果非inode
142  error等于负ENOMEM
143  转到:out1
146  Stat data, not accessed from path walking 等于get_next_ino()
147  i_mode等于mode
148  i_atime等于i_mtime等于i_ctime等于current_time(inode)
149  s or device private pointer 等于data
150  如果S_ISDIR(mode)则
151  i_op等于simple_dir_inode_operations
152  rmer ->i_op->default_file_ops 等于simple_dir_operations
153  inc_nlink(inode)
154  inc_nlink(dir)
155  否则如果S_ISLNK(mode)则
156  i_op等于如果iopsiops否则simple_symlink_inode_operations
157  i_link等于data
158  否则
159  rmer ->i_op->default_file_ops 等于fops
161  为目录项建立索引
162  获得目录项引用
163  inode_unlock(dir)
164  返回:dentry
166  out1 :
167  dput(dentry)
168  dentry等于错误号
169  out :
170  inode_unlock(dir)
171  simple_release_fs( & mount, & mount_count)
172  返回:dentry
调用者
名称描述
securityfs_create_filesecurityfs_create_file - create a file in the securityfs filesystem*@name: a pointer to a string containing the name of the file to create.*@mode: the permission that the file should have*@parent: a pointer to the parent dentry for this file
securityfs_create_symlinksecurityfs_create_symlink - create a symlink in the securityfs filesystem*@name: a pointer to a string containing the name of the symlink to* create.*@parent: a pointer to the parent dentry for the symlink. This should be a* directory dentry if set