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

# vfs\_mountedon(9)

check if the vnode belongs to a mounted file system

## NAME

**vfs\_mountedon** – check if the vnode belongs to a mounted file system

## SYNOPSIS

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

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

*int*\

**vfs\_mountedon**(*struct vnode \*vp*);

## DESCRIPTION

**vfs\_mountedon**() inspects the *mount* structure in *vp* to determine if it points to a valid mount point. If the mount is valid, the vnode is considered to be busy.

A common use of **vfs\_mountedon**() is to call it on device vnodes to determine if they are already associated with a file system. This is done to prevent multiple mounts on the same device.

## RETURN VALUES

EBUSY is returned if the vnode has a valid mount point; otherwise, 0 is returned.

## PSEUDOCODE

```
int
ffs_mountfs(devvp, mp, td, malloctype)
	register struct vnode *devvp;
	struct mount *mp;
	struct thread *td;
	struct malloc_type *malloctype;
{
	...
	error = vfs_mountedon(devvp);
	if (error)
		return (error);
	...
}
```

## AUTHORS

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