xref: /freebsd/share/man/man9/VOP_VPTOCNP.9 (revision 09a53ad8f1318c5daae6cfb19d97f4f6459f0013)
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.\" $FreeBSD$
30.\"
31.Dd March 8, 2015
32.Dt VOP_VPTOCNP 9
33.Os
34.Sh NAME
35.Nm VOP_VPTOCNP
36.Nd translate a vnode to its component name
37.Sh SYNOPSIS
38.In sys/param.h
39.In sys/ucred.h
40.In sys/vnode.h
41.Ft int
42.Fn VOP_VPTOCNP "struct vnode *vp" "struct vnode **dvp" "struct ucred *cred" "char *buf" "int *buflen"
43.Sh DESCRIPTION
44This translates a vnode into its component name, and writes that name to
45the head of the buffer specified by
46.Fa buf .
47.Bl -tag -width buflen
48.It Fa vp
49The vnode to translate.
50.It Fa dvp
51The vnode of the parent directory of
52.Fa vp .
53.It Fa cred
54The caller credentials.
55.It Fa buf
56The buffer into which to prepend the component name.
57.It Fa buflen
58The remaining size of the buffer.
59.El
60.Pp
61The default implementation of
62.Nm
63scans through
64.Fa vp Ns 's
65parent directory looking for a dirent with a matching file number.
66If
67.Fa vp
68is not a directory, then
69.Nm
70returns ENOENT.
71.Sh LOCKS
72The vnode should be locked on entry and will still be locked on exit.
73The parent directory vnode will be unlocked on a successful exit.
74However, it will have its use count incremented.
75.Sh RETURN VALUES
76Zero is returned on success, otherwise an error code is returned.
77.Sh ERRORS
78.Bl -tag -width Er
79.It Bq Er ENOMEM
80The buffer was not large enough to hold the vnode's component name.
81.It Bq Er ENOENT
82The vnode was not found on the file system.
83.El
84.Sh SEE ALSO
85.Xr vnode 9 ,
86.Xr VOP_LOOKUP 9
87.Sh NOTES
88This interface is a work in progress.
89.Sh HISTORY
90The function
91.Nm
92appeared in
93.Fx 8.0 .
94.Sh AUTHORS
95This manual page was written by
96.An Joe Marcus Clarke .
97