---
name: "vfs_getnewfsid"
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_getnewfsid"
---

# vfs\_getnewfsid(9)

allocate a new file system identifier

## NAME

**vfs\_getnewfsid** – allocate a new file system identifier

## SYNOPSIS

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

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

*void*\

**vfs\_getnewfsid**(*struct mount \*mp*);

## DESCRIPTION

The **vfs\_getnewfsid**() function allocates a new file system identifier for the mount point given. File systems typically call **vfs\_getnewfsid**() in their mount routine in order to acquire a unique ID within the system which can later be used to uniquely identify the file system via calls such as [vfs\_getvfs(9)](/vfs_getvfs/9.md).

The actual *fsid* is made up of two 32 bit integers, that are stored in the *statfs* structure of *mp*. The first integer is unique in the set of mounted file systems, while the second holds the file system type.

```
typedef	struct fsid {
	int32_t val[2];
} fsid_t;
```

## PSEUDOCODE

```
xxx_mount(struct mount *mp, char *path, caddr_t data,
	struct nameidata *ndp, struct thread *td)
{
	...
	vfs_getnewfsid(mp);
	...
}
```

## SEE ALSO

[vfs\_getvfs(9)](/vfs_getvfs/9.md)

## AUTHORS

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