xref: /freebsd/share/man/man9/vfs_getvfs.9 (revision ffc0b97fd087519392b19a9d43056d7099b831eb)
1ffc0b97fSAlfred Perlstein.\"
2ffc0b97fSAlfred Perlstein.\" Copyright (C) 2001 Chad David <davidc@acns.ab.ca>. All rights reserved.
3ffc0b97fSAlfred Perlstein.\"
4ffc0b97fSAlfred Perlstein.\" Redistribution and use in source and binary forms, with or without
5ffc0b97fSAlfred Perlstein.\" modification, are permitted provided that the following conditions
6ffc0b97fSAlfred Perlstein.\" are met:
7ffc0b97fSAlfred Perlstein.\" 1. Redistributions of source code must retain the above copyright
8ffc0b97fSAlfred Perlstein.\"    notice(s), this list of conditions and the following disclaimer as
9ffc0b97fSAlfred Perlstein.\"    the first lines of this file unmodified other than the possible
10ffc0b97fSAlfred Perlstein.\"    addition of one or more copyright notices.
11ffc0b97fSAlfred Perlstein.\" 2. Redistributions in binary form must reproduce the above copyright
12ffc0b97fSAlfred Perlstein.\"    notice(s), this list of conditions and the following disclaimer in the
13ffc0b97fSAlfred Perlstein.\"    documentation and/or other materials provided with the distribution.
14ffc0b97fSAlfred Perlstein.\"
15ffc0b97fSAlfred Perlstein.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
16ffc0b97fSAlfred Perlstein.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17ffc0b97fSAlfred Perlstein.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18ffc0b97fSAlfred Perlstein.\" DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
19ffc0b97fSAlfred Perlstein.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20ffc0b97fSAlfred Perlstein.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21ffc0b97fSAlfred Perlstein.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22ffc0b97fSAlfred Perlstein.\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23ffc0b97fSAlfred Perlstein.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24ffc0b97fSAlfred Perlstein.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
25ffc0b97fSAlfred Perlstein.\" DAMAGE.
26ffc0b97fSAlfred Perlstein.\"
27ffc0b97fSAlfred Perlstein.\" $FreeBSD$
28ffc0b97fSAlfred Perlstein.\"
29ffc0b97fSAlfred Perlstein.Dd November 21, 2001
30ffc0b97fSAlfred Perlstein.Dt VFS_GETVFS 9
31ffc0b97fSAlfred Perlstein.Os
32ffc0b97fSAlfred Perlstein.Sh NAME
33ffc0b97fSAlfred Perlstein.Nm vfs_getvfs
34ffc0b97fSAlfred Perlstein.Nd "returns a mount point given its fsid"
35ffc0b97fSAlfred Perlstein.Sh SYNOPSIS
36ffc0b97fSAlfred Perlstein.In sys/param.h
37ffc0b97fSAlfred Perlstein.In sys/mount.h
38ffc0b97fSAlfred Perlstein.Ft struct mount *
39ffc0b97fSAlfred Perlstein.Fn vfs_getvfs "fsid_t *fsid"
40ffc0b97fSAlfred Perlstein.Sh DESCRIPTION
41ffc0b97fSAlfred PerlsteinThe
42ffc0b97fSAlfred Perlstein.Fn vfs_getvfs
43ffc0b97fSAlfred Perlsteinfunction returns the mount point structure for a filesystem given its filesystem
44ffc0b97fSAlfred Perlsteinidentifier.  The filesystem id should have been allocated by calling
45ffc0b97fSAlfred Perlstein.Fn vfs_getnewfsid ;
46ffc0b97fSAlfred Perlsteinotherwise, it will not be found.
47ffc0b97fSAlfred Perlstein.Pp
48ffc0b97fSAlfred PerlsteinA major user of
49ffc0b97fSAlfred Perlstein.Fn vfs_getvfs
50ffc0b97fSAlfred Perlsteinis NFS, which uses the fsid as part of file handles in order to determine the
51ffc0b97fSAlfred Perlsteinfilesystem a given RPC is for.
52ffc0b97fSAlfred PerlsteinIf
53ffc0b97fSAlfred Perlstein.Fn vfs_getvfs
54ffc0b97fSAlfred Perlsteinfails to find the mount point related to
55ffc0b97fSAlfred Perlstein.Fa fsid
56ffc0b97fSAlfred Perlsteinthe filesystem is considered stale.
57ffc0b97fSAlfred Perlstein.Sh RETURN VALUES
58ffc0b97fSAlfred PerlsteinIf
59ffc0b97fSAlfred Perlstein.Fa fsid
60ffc0b97fSAlfred Perlsteinis found the mount point for the id is returned; otherwise,
61ffc0b97fSAlfred Perlstein.Dv NULL
62ffc0b97fSAlfred Perlsteinis returned.
63ffc0b97fSAlfred Perlstein.Sh PSEUDOCODE
64ffc0b97fSAlfred Perlstein.Bd -literal
65ffc0b97fSAlfred Perlstein	if ((mp = vfs_getvfs(&fhp->fh_fsid)) == NULL) {
66ffc0b97fSAlfred Perlstein		error = ESTALE;
67ffc0b97fSAlfred Perlstein		goto out;
68ffc0b97fSAlfred Perlstein	}
69ffc0b97fSAlfred Perlstein.Ed
70ffc0b97fSAlfred Perlstein.Sh AUTHORS
71ffc0b97fSAlfred PerlsteinThis man page was written by
72ffc0b97fSAlfred Perlstein.An Chad David Aq davidc@acns.ab.ca .
73