---
name: "vfs_setlease"
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_setlease"
---

# vfs\_setlease(9)

sets a lease on an open file

## NAME

vfs\_setlease - sets a lease on an open file

## SYNOPSIS

**int vfs\_setlease(struct file \*** *filp***, long** *arg***, struct file\_lock \*\*** *lease***, void \*\*** *priv***);**

## ARGUMENTS

*filp*

file pointer

*arg*

type of lease to obtain

*lease*

file\_lock to use when adding a lease

*priv*

private info for lm\_setup when adding a lease (may be NULL if lm\_setup doesn't require it)

## DESCRIPTION

Call this to establish a lease on the file. The “lease” argument is not used for F\_UNLCK requests and may be NULL. For commands that set or alter an existing lease, the (\*lease)-\>fl\_lmops-\>lm\_break operation must be set; if not, this function will return -ENOLCK (and generate a scary-looking stack trace).

The “priv” pointer is passed directly to the lm\_setup function as-is. It may be NULL if the lm\_setup operation doesn't require it.

## COPYRIGHT
