Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\namei.c Create Date:2022-07-28 20:05:14
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:filename_create

Proto:static struct dentry *filename_create(int dfd, struct filename *name, struct path *path, unsigned int lookup_flags)

Type:struct dentry

Parameter:

TypeParameterName
intdfd
struct filename *name
struct path *path
unsigned intlookup_flags
3547  dentry = ERR_PTR( - EEXIST)
3552  is_dir = lookup_flags & quire a directory
3558  lookup_flags &= ll ->d_revalidate() to trust no cache
3560  name = filename_parentat(dfd, name, lookup_flags, path, & last, & type)
3561  If IS_ERR(name) Then Return ERR_CAST - Explicitly cast an error-valued pointer to another pointer type*@ptr: The pointer to cast.* Explicitly cast an error-valued pointer to another pointer type in such a* way as to make it clear that's what's going on.
3568  If Value for the false possibility is greater at compile time(type != LAST_NORM) Then Go to out
3572  err2 = mnt_want_write(mnt)
3576  lookup_flags |= ... in object creation | ... in exclusive creation
3577  inode_lock_nested( Where the name belongs to - NULL is * negative , I_MUTEX_PARENT)
3578  dentry = Parent directory has inode locked exclusive. This is one* and only case when ->lookup() gets called on non in-lookup* dentries - as the matter of fact, this only gets called* when directory is guaranteed to have no in-lookup children* at all.
3579  If IS_ERR(dentry) Then Go to unlock
3582  error = -EEXIST
3583  If d_is_positive(dentry) Then Go to fail
3592  If Value for the false possibility is greater at compile time(!is_dir && name[len]) Then
3593  error = -ENOENT
3594  Go to fail
3596  If Value for the false possibility is greater at compile time(err2) Then
3597  error = err2
3598  Go to fail
3600  putname(name)
3601  Return dentry
3602  fail :
3603  dput(dentry)
3604  dentry = ERR_PTR(error)
3605  unlock :
3606  inode_unlock( Where the name belongs to - NULL is * negative )
3607  If Not err2 Then mnt_drop_write(mnt)
3609  out :
3610  path_put - put a reference to a path*@path: path to put the reference to* Given a path decrement the reference count to the dentry and the vfsmount.
3611  putname(name)
3612  Return dentry
Caller
NameDescribe
kern_path_create
user_path_create