---
name: "vfs_link"
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_link"
---

# vfs\_link(9)

create a new link

## NAME

vfs\_link - create a new link

## SYNOPSIS

**int vfs\_link(struct dentry \*** *old\_dentry***, struct inode \*** *dir***, struct dentry \*** *new\_dentry***, struct inode \*\*** *delegated\_inode***);**

## ARGUMENTS

*old\_dentry*

object to be linked

*dir*

new parent

*new\_dentry*

where to create the new link

*delegated\_inode*

returns inode needing a delegation break

## DESCRIPTION

The caller must hold dir-\>i\_mutex

If vfs\_link discovers a delegation on the to-be-linked file in need of breaking, it will return -EWOULDBLOCK and return a reference to the inode in delegated\_inode. The caller should then break the delegation and retry. Because breaking a delegation may take a long time, the caller should drop the 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
