---
name: "VFS_ROOT"
section: "9"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/VFS_ROOT"
---

# VFS\_ROOT(9)

return the root vnode of a file system

## NAME

**VFS\_ROOT** – return the root vnode of a file system

## SYNOPSIS

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

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

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

*int*\

**VFS\_ROOT**(*struct mount \*mp*, *int flags*, *struct vnode \*\*vpp*);

## DESCRIPTION

Return a locked vnode for the root directory of the file system.

Its arguments are:

- *mp*

  The file system.

- *flags*

  The lock type. Could be LK\_EXCLUSIVE or LK\_SHARED. File system is free to ignore the *flags* argument and instead acquire an exclusive lock.

- *vpp*

  Return parameter for the root vnode.

## SEE ALSO

[VFS(9)](/VFS/9.md), [vnode(9)](/vnode/9.md)

## AUTHORS

This manual page was written by Doug Rabson.
