---
name: "vfs_unlink"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/vfs_unlink"
---

# vfs\_unlink(9)

unlink a filesystem object

## NAME

vfs\_unlink - unlink a filesystem object

## SYNOPSIS

**int vfs\_unlink(struct inode \*** *dir***, struct dentry \*** *dentry***, struct inode \*\*** *delegated\_inode***);**

## ARGUMENTS

*dir*

parent directory

*dentry*

victim

*delegated\_inode*

returns victim inode, if the inode is delegated.

## DESCRIPTION

The caller must hold dir-\>i\_mutex.

If vfs\_unlink discovers a delegation, it will return -EWOULDBLOCK and return a reference to the inode in delegated\_inode. The caller should then break the delegation on that inode and retry. Because breaking a delegation may take a long time, the caller should drop dir-\>i\_mutex before doing so.

Alternatively, a caller may pass NULL for delegated\_inode. This may be appropriate for callers that expect the underlying filesystem not to be NFS exported.

## COPYRIGHT
