1.\" -*- nroff -*- 2.\" 3.\" Copyright (c) 2008 Joe Marcus Clarke 4.\" 5.\" All rights reserved. 6.\" 7.\" This program is free software. 8.\" 9.\" Redistribution and use in source and binary forms, with or without 10.\" modification, are permitted provided that the following conditions 11.\" are met: 12.\" 1. Redistributions of source code must retain the above copyright 13.\" notice, this list of conditions and the following disclaimer. 14.\" 2. Redistributions in binary form must reproduce the above copyright 15.\" notice, this list of conditions and the following disclaimer in the 16.\" documentation and/or other materials provided with the distribution. 17.\" 18.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR 19.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, 22.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 23.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28.\" 29.Dd March 8, 2015 30.Dt VOP_VPTOCNP 9 31.Os 32.Sh NAME 33.Nm VOP_VPTOCNP 34.Nd translate a vnode to its component name 35.Sh SYNOPSIS 36.In sys/param.h 37.In sys/ucred.h 38.In sys/vnode.h 39.Ft int 40.Fn VOP_VPTOCNP "struct vnode *vp" "struct vnode **dvp" "struct ucred *cred" "char *buf" "int *buflen" 41.Sh DESCRIPTION 42This translates a vnode into its component name, and writes that name to 43the head of the buffer specified by 44.Fa buf . 45.Bl -tag -width buflen 46.It Fa vp 47The vnode to translate. 48.It Fa dvp 49The vnode of the parent directory of 50.Fa vp . 51.It Fa cred 52The caller credentials. 53.It Fa buf 54The buffer into which to prepend the component name. 55.It Fa buflen 56The remaining size of the buffer. 57.El 58.Pp 59The default implementation of 60.Nm 61scans through 62.Fa vp Ns 's 63parent directory looking for a dirent with a matching file number. 64If 65.Fa vp 66is not a directory, then 67.Nm 68returns ENOENT. 69.Sh LOCKS 70The vnode should be locked on entry and will still be locked on exit. 71The parent directory vnode will be unlocked on a successful exit. 72However, it will have its use count incremented. 73.Sh RETURN VALUES 74Zero is returned on success, otherwise an error code is returned. 75.Sh ERRORS 76.Bl -tag -width Er 77.It Bq Er ENOMEM 78The buffer was not large enough to hold the vnode's component name. 79.It Bq Er ENOENT 80The vnode was not found on the file system. 81.El 82.Sh SEE ALSO 83.Xr vnode 9 , 84.Xr VOP_LOOKUP 9 85.Sh NOTES 86This interface is a work in progress. 87.Sh HISTORY 88The function 89.Nm 90appeared in 91.Fx 8.0 . 92.Sh AUTHORS 93This manual page was written by 94.An Joe Marcus Clarke . 95