]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - share/man/man9/VFS_LOCK_GIANT.9
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / share / man / man9 / VFS_LOCK_GIANT.9
1 .\"
2 .\" Copyright (c) 2005 Robert N. M. Watson
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice(s), this list of conditions and the following disclaimer as
10 .\"    the first lines of this file unmodified other than the possible
11 .\"    addition of one or more copyright notices.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\"    notice(s), this list of conditions and the following disclaimer in the
14 .\"    documentation and/or other materials provided with the distribution.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
17 .\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 .\" DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
20 .\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 .\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 .\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 .\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
26 .\" DAMAGE.
27 .\"
28 .\" $FreeBSD$
29 .\"
30 .Dd September 21, 2005
31 .Dt VFS_LOCK_GIANT 9
32 .Os
33 .Sh NAME
34 .Nm VFS_LOCK_GIANT ,
35 .Nm VFS_UNLOCK_GIANT
36 .Nd "conditionally lock and unlock Giant around entry into VFS"
37 .Sh SYNOPSIS
38 .In sys/param.h
39 .In sys/mount.h
40 .In sys/vnode.h
41 .Ft int
42 .Fn VFS_LOCK_GIANT "struct mount *mp"
43 .Ft void
44 .Fn VFS_UNLOCK_GIANT "int vfslocked"
45 .Sh DESCRIPTION
46 .Fn VFS_LOCK_GIANT
47 will conditionally acquire the
48 .Va Giant
49 lock if the file system referenced by
50 .Fa mp
51 is marked as MPSAFE or not, returning a flag indicating whether
52 .Va Giant
53 was
54 set, which may later be passed to
55 .Fn VFS_UNLOCK_GIANT .
56 The value of
57 .Fa mp
58 will typically be derived from the mount pointer in a
59 .Vt vnode
60 on which a VFS operation will be performed.
61 .Pp
62 .Fn VFS_UNLOCK_GIANT
63 conditionally releases the
64 .Va Giant
65 lock if the passed
66 .Fa vfslocked
67 argument is non-zero.
68 It is expected that the argument will be derived from the return values of
69 .Fn VFS_LOCK_GIANT
70 or
71 .Xr NDHASGIANT 9 .
72 .Sh RETURN VALUES
73 .Fn VFS_LOCK_GIANT
74 returns a boolean indicating whether or not
75 .Va Giant
76 was acquired.
77 .Sh SEE ALSO
78 .Xr mutex 9 ,
79 .Xr NDHASGIANT 9 ,
80 .Xr vnode 9
81 .Sh AUTHORS
82 .An -nosplit
83 MPSAFE VFS support for
84 .Fx
85 was implemented by
86 .An Jeff Roberson .
87 .Pp
88 This manual page was written by
89 .An Robert Watson .
90 .Sh BUGS
91 Non-MPSAFE file systems exist, requiring callers conditional locking and
92 unlocking of
93 .Va Giant .