---
name: "vfs_busy"
section: "9"
platform: "linux"
package: "freebsd-manpages"
version: "6.0-5"
release: "Debian 4.0 (Etch)"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/vfs_busy"
---

# vfs\_busy(9)

marks a mount point as busy

## NAME

**vfs\_busy** – marks a mount point as busy

## SYNOPSIS

**#include \<sys/param.h\>**

**#include \<sys/mount.h\>**

*int*\

**vfs\_busy**(*struct mount \*mp*, *int flags*, *struct mtx \*interlkp*, *struct thread \*td*);

## DESCRIPTION

The **vfs\_busy**() function marks a mount point as busy. The purpose of this function is to synchronize access to a mount point. It also delays unmounting by sleeping on *mp* if the MNTK\_UNMOUNT flag is set in *mp-\>mnt\_kern\_flag* and the LK\_NOWAIT flag is *not* set.

Its arguments are:

- *mp*

  The mount point to busy.

- *flags*

  Flags controlling how **vfs\_busy**() should act.

  - LK\_NOWAIT

    do not sleep if MNTK\_UNMOUNT is set.

- *interlkp*

  The interlock mutex for *mp-\>mount\_lock*. If there is any chance the mount point is being unmounted and LK\_NOWAIT is not set then interlock must be valid locked mutex.

- *td*

  The thread responsible for this call.

## LOCKS

If *interlkp* is a valid pointer it must be locked on entry, and it will not be unlocked even in the case of an error.

## RETURN VALUES

A 0 value is returned on success. If the mount point is being unmounted ENOENT will always be returned.

## ERRORS

- \[ENOENT\]

  The mount point is being unmounted (MNTK\_UNMOUNT is set).

## AUTHORS

This manual page was written by Chad David ⟨davidc@acns.ab.ca⟩.
