]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man9/VFS_LOCK_GIANT.9
This commit was generated by cvs2svn to compensate for changes in r151513,
[FreeBSD/FreeBSD.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/vnode.h
40 .Ft int
41 .Fn VFS_LOCK_GIANT "struct mount *mp"
42 .Ft void
43 .Fn VFS_UNLOCK_GIANT "int vfslocked"
44 .Sh DESCRIPTION
45 .Fn VFS_LOCK_GIANT
46 will conditionally acquire the
47 .Dv Giant
48 lock if the file system referenced by
49 .Fa mp
50 is marked as MPSAFE or not, returning a flag indicating whether Giant was
51 set, which may later be passed to
52 .Fn VFS_UNLOCK_GIANT .
53 The value of
54 .Fa mp
55 will typically be derived from the mount pointer in a
56 .Xr vnode
57 on which a VFS operation will be performed.
58 .Pp
59 .Fn VFS_UNLOCK_GIANT
60 conditionally releases the
61 .Va Giant
62 lock if the passed
63 .Fa vfslocked
64 argument is non-zero.
65 It is expected that the argument will be derived from the return values of
66 .Vn VFS_LOCK_GIANT
67 or
68 .Xr NDHASGIANT 9 .
69 .Sh RETURN VALUES
70 .Fn VFS_LOCK_GIANT
71 returns a boolean indicating whether or not
72 .Va Giant
73 was acquired.
74 .Sh SEE ALSO
75 .Xr mutex 9 ,
76 .Xr NDHASGIANT 9 ,
77 .Xr vnode 9
78 .Sh AUTHORS
79 MPSAFE VFS support for
80 .Fx
81 was implemented by
82 .An Jeff Roberson .
83 .Pp
84 This manual page was written by
85 .An Robert Watson .
86 .Sh BUGS
87 .Pp
88 Non-MPSAFE file systems exist, requiring callers conditional locking and
89 unlocking of
90 .Va Giant .