Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Make sure that the actual truncation of the file will occur outside its* directory's i_mutex. Truncate can take a long time if there is a lot of* writeout happening, and we don't want to prevent access to the directory* while waiting on the I/O.

Proto:long do_unlinkat(int dfd, struct filename *name)

Type:long

Parameter:

TypeParameterName
intdfd
struct filename *name
3976  struct inode * inode = NULL
3977  struct inode * delegated_inode = NULL
3978  lookup_flags = 0
3979  retry :
3980  name = filename_parentat(dfd, name, lookup_flags, & path, & last, & type)
3981  If IS_ERR(name) Then Return PTR_ERR(name)
3984  error = -EISDIR
3985  If type != LAST_NORM Then Go to exit1
3988  error = mnt_want_write(mnt)
3989  If error Then Go to exit1
3991  retry_deleg :
3992  inode_lock_nested( Where the name belongs to - NULL is * negative , I_MUTEX_PARENT)
3993  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.
3994  error = PTR_ERR(dentry)
3995  If Not IS_ERR(dentry) Then
3997  If name[len] Then Go to slashes
3999  inode = Where the name belongs to - NULL is * negative
4000  If d_is_negative(dentry) Then Go to slashes
4002  ihold(inode)
4003  error = security_path_unlink( & path, dentry)
4004  If error Then Go to exit2
4006  error = vfs_unlink - unlink a filesystem object*@dir: parent directory*@dentry: victim*@delegated_inode: returns victim inode, if the inode is delegated.* The caller must hold dir->i_mutex.* If vfs_unlink discovers a delegation, it will return -EWOULDBLOCK and
4007  exit2 :
4008  dput(dentry)
4010  inode_unlock( Where the name belongs to - NULL is * negative )
4011  If inode Then put an inode
4013  inode = NULL
4014  If delegated_inode Then
4015  error = break_deleg_wait( & delegated_inode)
4016  If Not error Then Go to retry_deleg
4019  mnt_drop_write(mnt)
4020  exit1 :
4021  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.
4022  If ry_estale - determine whether the caller should retry an operation*@error: the error that would currently be returned*@flags: flags being used for next lookup attempt* Check to see if the error code was -ESTALE, and then determine whether Then
4023  lookup_flags |= ll ->d_revalidate() to trust no cache
4024  inode = NULL
4025  Go to retry
4027  putname(name)
4028  Return error
4030  slashes :
4031  If d_is_negative(dentry) Then error = -ENOENT
4033  Else if d_is_dir(dentry) Then error = -EISDIR
4035  Else error = -ENOTDIR
4037  Go to exit2
Caller
NameDescribe
SYSCALL_DEFINE3
SYSCALL_DEFINE1
do_coredump
ksys_unlink