xref: /freebsd/share/man/man9/BUF_ISLOCKED.9 (revision 8a7314fcb5347f8296a072e0c4f67a9f64303186)
1.\"
2.\" Copyright (C) 2008 Attilio Rao <attilio@FreeBSD.org>
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 January 22, 2008
31.Dt BUF_ISLOCKED 9
32.Os
33.Sh NAME
34.Nm BUF_ISLOCKED
35.Nd "returns the state of the lock linked to the buffer"
36.Sh SYNOPSIS
37.In sys/param.h
38.In sys/systm.h
39.In sys/uio.h
40.In sys/bio.h
41.In sys/buf.h
42.Ft int
43.Fn BUF_ISLOCKED "struct buf *bp"
44.Sh DESCRIPTION
45The
46.Fn BUF_ISLOCKED
47function returns the status of the lock linked to the buffer in relation to
48curthread.
49.Pp
50It can return:
51.Bl -tag -width ".Dv LK_EXCLUSIVE"
52.It Dv LK_EXCLUSIVE
53An exclusive lock is held by curthread.
54.It Dv LK_EXCLOTHER
55An exclusive lock is held by someone other than curthread.
56.It Dv LK_SHARED
57A shared lock is held.
58.It Li 0
59The lock is not held by anyone.
60.El
61.Sh SEE ALSO
62.Xr lockstatus 9 ,
63.Xr buf 9 ,
64.Xr BUF_LOCK 9 ,
65.Xr BUF_UNLOCK 9 ,
66.Xr lockmgr 9
67.Sh AUTHORS
68This manual page was written by
69.An Attilio Rao Aq Mt attilio@FreeBSD.org .
70