Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:do_rmdir

Proto:long do_rmdir(int dfd, const char __user *pathname)

Type:long

Parameter:

TypeParameterName
intdfd
const char __user *pathname
3842  error = 0
3848  lookup_flags = 0
3849  retry :
3850  name = filename_parentat(dfd, getname(pathname), lookup_flags, & path, & last, & type)
3852  If IS_ERR(name) Then Return PTR_ERR(name)
3856  Case type == LAST_DOTDOT
3857  error = -ENOTEMPTY
3858  Go to exit1
3859  Case type == LAST_DOT
3860  error = -EINVAL
3861  Go to exit1
3862  Case type == LAST_ROOT
3863  error = -EBUSY
3864  Go to exit1
3867  error = mnt_want_write(mnt)
3868  If error Then Go to exit1
3871  inode_lock_nested( Where the name belongs to - NULL is * negative , I_MUTEX_PARENT)
3872  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.
3873  error = PTR_ERR(dentry)
3874  If IS_ERR(dentry) Then Go to exit2
3876  If Not Where the name belongs to - NULL is * negative Then
3877  error = -ENOENT
3878  Go to exit3
3880  error = security_path_rmdir( & path, dentry)
3881  If error Then Go to exit3
3883  error = vfs_rmdir( Where the name belongs to - NULL is * negative , dentry)
3884  exit3 :
3885  dput(dentry)
3886  exit2 :
3887  inode_unlock( Where the name belongs to - NULL is * negative )
3888  mnt_drop_write(mnt)
3889  exit1 :
3890  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.
3891  putname(name)
3892  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
3893  lookup_flags |= ll ->d_revalidate() to trust no cache
3894  Go to retry
3896  Return error
Caller
NameDescribe
SYSCALL_DEFINE1
SYSCALL_DEFINE3
ksys_rmdir