---
name: "vfs_getvfs"
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_getvfs"
---

# vfs\_getvfs(9)

returns a mount point given its file system identifier

## NAME

**vfs\_getvfs** – returns a mount point given its file system identifier

## SYNOPSIS

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

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

*struct mount \**\

**vfs\_getvfs**(*fsid\_t \*fsid*);

## DESCRIPTION

The **vfs\_getvfs**() function returns the mount point structure for a file system given its file system identifier. The file system ID should have been allocated by calling [vfs\_getnewfsid(9)](/vfs_getnewfsid/9.md); otherwise, it will not be found.

A major user of **vfs\_getvfs**() is NFS, which uses the *fsid* as part of file handles in order to determine the file system a given RPC is for. If **vfs\_getvfs**() fails to find the mount point related to *fsid*, the file system is considered stale.

## RETURN VALUES

If *fsid* is found, the mount point for the ID is returned; otherwise, NULL is returned.

## PSEUDOCODE

```
if ((mp = vfs_getvfs(&fhp->fh_fsid)) == NULL) {
	error = ESTALE;
	goto out;
}
```

## SEE ALSO

[vfs\_getnewfsid(9)](/vfs_getnewfsid/9.md)

## AUTHORS

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