Copyright (c) 2008 Joe Marcus Clarke
All rights reserved.
This program is free software.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
$FreeBSD: releng/10.2/share/man/man9/VOP_VPTOCNP.9 280498 2015-03-25 09:54:07Z dchagin $
.Dd March 8, 2015 .Dt VOP_VPTOCNP 9 .Os .Sh NAME .Nm VOP_VPTOCNP .Nd translate a vnode to its component name .Sh SYNOPSIS n sys/param.h n sys/ucred.h n sys/vnode.h .Ft int .Fn VOP_VPTOCNP "struct vnode *vp" "struct vnode **dvp" "struct ucred *cred" "char *buf" "int *buflen" .Sh DESCRIPTION This translates a vnode into its component name, and writes that name to the head of the buffer specified by .Fa buf . l -tag -width buflen t Fa vp The vnode to translate. t Fa dvp The vnode of the parent directory of .Fa vp . t Fa cred The caller credentials. t Fa buf The buffer into which to prepend the component name. t Fa buflen The remaining size of the buffer. .El
p The default implementation of .Nm scans through .Fa vp Ns 's parent directory looking for a dirent with a matching file number. If .Fa vp is not a directory, then .Nm returns ENOENT. .Sh 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. .Sh RETURN VALUES Zero is returned on success, otherwise an error code is returned. .Sh ERRORS l -tag -width Er t Bq Er ENOMEM The buffer was not large enough to hold the vnode's component name. t Bq Er ENOENT The vnode was not found on the file system. .El .Sh SEE ALSO .Xr VOP_LOOKUP 9 , .Xr vnode 9 .Sh NOTES This interface is a work in progress. .Sh HISTORY The function .Nm appeared in .Fx 8.0 . .Sh AUTHORS This manual page was written by .An Joe Marcus Clarke .