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: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

Proto:int vfs_unlink(struct inode *dir, struct dentry *dentry, struct inode **delegated_inode)

Type:int

Parameter:

TypeParameterName
struct inode *dir>i_mutex before doing so.
struct dentry *dentry
struct inode **delegated_inode
3924  target = Where the name belongs to - NULL is * negative
3925  error = Check whether we can remove a link victim from directory dir, check* whether the type of victim is right.* 1. We can't do it if dir is read-only (done in permission())* 2. We should have write and exec permissions on dir* 3
3927  If error Then Return error
3930  If Not unlink Then Return -EPERM
3933  inode_lock(target)
3934  If is_local_mountpoint(dentry) Then error = -EBUSY
3936  Else
3937  error = security_inode_unlink(>i_mutex before doing so., dentry)
3938  If Not error Then
3940  If error Then Go to out
3943  If Not error Then
3950  out :
3951  inode_unlock(target)
3954  If Not error && Not ( protected by d_lock & DCACHE_NFSFS_RENAMED) Then
3955  snotify_link_count - inode's link count changed
3956  delete a dentry
3959  Return error
Caller
NameDescribe
do_unlinkatMake 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.