函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\namei.c Create Date:2022-07-29 10:35:09
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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

函数原型:int vfs_unlink(struct inode *dir, struct dentry *dentry, struct inode **delegated_inode)

返回类型:int

参数:

类型参数名称
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  如果error则返回:error
3930  如果非unlink则返回:负EPERM
3933  inode_lock(target)
3934  如果is_local_mountpoint(dentry)则error等于负EBUSY
3936  否则
3937  error等于security_inode_unlink(>i_mutex before doing so., dentry)
3938  如果非error
3940  如果error则转到:out
3943  如果非error
3950  out :
3951  inode_unlock(target)
3954  如果非error且非 protected by d_lock 按位与DCACHE_NFSFS_RENAMED的值则
3955  snotify_link_count - inode's link count changed
3956  删除目录项
3959  返回:error
调用者
名称描述
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.