Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\apparmor\apparmorfs.c Create Date:2022-07-28 19:49:55
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:aafs_create - create a dentry in the apparmorfs filesystem*@name: name of dentry to create*@mode: permissions the file should have*@parent: parent directory for this dentry*@data: data to store on inode

Proto:static struct dentry *aafs_create(const char *name, umode_t mode, struct dentry *parent, void *data, void *link, const struct file_operations *fops, const struct inode_operations *iops)

Type:struct dentry

Parameter:

TypeParameterName
const char *name
umode_tmode
struct dentry *parent
void *data
void *link
const struct file_operations *fops
const struct inode_operations *iops
270  AA_BUG(!name)
271  AA_BUG(!parent)
273  If Not (mode & S_IFMT) Then mode = mode & S_IALLUGO | S_IFREG
276  error = simple_pin_fs( & aafs_ops, & aafs_mnt, & aafs_count)
277  If error Then Return ERR_PTR(error)
280  dir = d_inode - Get the actual inode of this dentry*@dentry: The dentry to query* This is the helper normal filesystems should use to get at their own inodes* in their own dentries and ignore the layering superimposed upon them.
282  inode_lock(dir)
283  dentry = lookup_one_len(name, parent, strlen - Find the length of a string*@s: The string to be sized)
284  If IS_ERR(dentry) Then
285  error = PTR_ERR(dentry)
286  Go to fail_lock
289  If 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 Then
290  error = -EEXIST
291  Go to fail_dentry
294  error = __aafs_setup_d_inode - basic inode setup for apparmorfs*@dir: parent directory for the dentry*@dentry: dentry we are seting the inode up for*@mode: permissions the file should have*@data: data to store on inode
295  If error Then Go to fail_dentry
297  inode_unlock(dir)
299  Return dentry
301  fail_dentry :
302  dput(dentry)
304  fail_lock :
305  inode_unlock(dir)
306  simple_release_fs( & aafs_mnt, & aafs_count)
308  Return ERR_PTR(error)
Caller
NameDescribe
aafs_create_fileaafs_create_file - create a file in the apparmorfs filesystem*@name: name of dentry to create*@mode: permissions the file should have*@parent: parent directory for this dentry*@data: data to store on inode
aafs_create_diraafs_create_dir - create a directory in the apparmorfs filesystem*@name: name of dentry to create*@parent: parent directory for this dentry* see aafs_create
aafs_create_symlinkaafs_create_symlink - create a symlink in the apparmorfs filesystem*@name: name of dentry to create*@parent: parent directory for this dentry*@target: if symlink, symlink target string*@private: private data*@iops: struct of inode_operations that should
__aafs_ns_mkdir_entriesassumes cleanup in caller