xref: /freebsd/share/man/man9/VFS_FHTOVP.9 (revision 7ef62cebc2f965b0f640263e179276928885e33d)
1.\" -*- nroff -*-
2.\"
3.\" Copyright (c) 1996 Doug Rabson
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 May 19, 2019
32.Dt VFS_FHTOVP 9
33.Os
34.Sh NAME
35.Nm VFS_FHTOVP
36.Nd turn an NFS filehandle into a vnode
37.Sh SYNOPSIS
38.In sys/param.h
39.In sys/mount.h
40.In sys/vnode.h
41.Ft int
42.Fn VFS_FHTOVP "struct mount *mp" "struct fid *fhp" "int flags" "struct vnode **vpp"
43.Sh DESCRIPTION
44The
45.Fn VFS_FHTOVP
46macro is used by the NFS server to turn an NFS filehandle into a vnode.
47.Pp
48The arguments it expects are:
49.Bl -tag -width flags
50.It Fa mp
51The file system.
52.It Fa fhp
53The filehandle to convert.
54.It Fa flags
55Additional locking flags to pass through to
56.Xr vget 9 .
57File systems are allowed to ignore
58.Ar flags
59and use
60.Dv LK_EXCLUSIVE
61instead.
62.It Fa vpp
63Return parameter for the new locked vnode.
64.El
65.Pp
66The contents of the filehandle are defined by the file system and are
67not examined by any other part of the system.
68It should contain
69enough information to uniquely identify a file within the file system
70as well as noticing when a file has been removed and the file system
71resources have been reused for a new file.
72For instance, UFS
73file system stores the inode number and inode generation counter in its
74filehandle.
75.Pp
76A call to
77.Fn VFS_FHTOVP
78should generally be preceded by a call to
79.Xr VFS_CHECKEXP 9
80to check if the file is accessible to the client.
81.Sh RETURN VALUES
82The locked vnode for the file will be returned in
83.Fa *vpp .
84.Sh SEE ALSO
85.Xr VFS 9 ,
86.Xr VFS_CHECKEXP 9 ,
87.Xr vnode 9 ,
88.Xr VOP_VPTOFH 9
89.Sh AUTHORS
90This manual page was written by
91.An Doug Rabson .
92