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

# VOP\_VPTOCNP(9)

translate a vnode to its component name

## NAME

**VOP\_VPTOCNP** – translate a vnode to its component name

## SYNOPSIS

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

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

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

*int*\

**VOP\_VPTOCNP**(*struct vnode \*vp*, *struct vnode \*\*dvp*, *struct ucred \*cred*, *char \*buf*, *int \*buflen*);

## DESCRIPTION

This translates a vnode into its component name, and writes that name to the head of the buffer specified by *buf*.

- *vp*

  The vnode to translate.

- *dvp*

  The vnode of the parent directory of *vp*.

- *cred*

  The caller credentials.

- *buf*

  The buffer into which to prepend the component name.

- *buflen*

  The remaining size of the buffer.

The default implementation of **VOP\_VPTOCNP** scans through *vp*'s parent directory looking for a dirent with a matching file number. If *vp* is not a directory, then **VOP\_VPTOCNP** returns ENOENT.

## LOCKS

The vnode should be locked on entry and will still be locked on exit. The parent directory vnode will be unlocked on a successful exit. However, it will have its use count incremented.

## RETURN VALUES

Zero is returned on success, otherwise an error code is returned.

## ERRORS

- \[ENOMEM\]

  The buffer was not large enough to hold the vnode's component name.

- \[ENOENT\]

  The vnode was not found on the file system.

## SEE ALSO

[vnode(9)](/vnode/9.md), [VOP\_LOOKUP(9)](/VOP_LOOKUP/9.md)

## NOTES

This interface is a work in progress.

## HISTORY

The function **VOP\_VPTOCNP** appeared in FreeBSD 8.0.

## AUTHORS

This manual page was written by Joe Marcus Clarke.
