---
title: vfs_mountedon
framework: Kernel
role: symbol
role_heading: Function
platforms: [macOS 10.4+]
path: kernel/1523197-vfs_mountedon
---

# vfs_mountedon

Check whether a given block device has a filesystem mounted on it.

## Declaration

```occ
int vfs_mountedon(struct vnode *vp);
```

## Parameters

- `vp`: The vnode to test.

## Return Value

Return Value EBUSY if vnode is indeed the source of a filesystem; 0 if it is not.

## Discussion

Discussion Note that this is NOT a check for a covered vnode (the directory upon which a filesystem is mounted)--it is a test for whether a block device is being used as the source of a filesystem. Note that a block device marked as being mounted on cannot be opened.
