xref: /freebsd/share/man/man9/BUF_LOCK.9 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
182ed18acSAlfred Perlstein.\"
282ed18acSAlfred Perlstein.\" Copyright (C) 2001 Chad David <davidc@acns.ab.ca>. All rights reserved.
382ed18acSAlfred Perlstein.\"
482ed18acSAlfred Perlstein.\" Redistribution and use in source and binary forms, with or without
582ed18acSAlfred Perlstein.\" modification, are permitted provided that the following conditions
682ed18acSAlfred Perlstein.\" are met:
782ed18acSAlfred Perlstein.\" 1. Redistributions of source code must retain the above copyright
882ed18acSAlfred Perlstein.\"    notice(s), this list of conditions and the following disclaimer as
982ed18acSAlfred Perlstein.\"    the first lines of this file unmodified other than the possible
1082ed18acSAlfred Perlstein.\"    addition of one or more copyright notices.
1182ed18acSAlfred Perlstein.\" 2. Redistributions in binary form must reproduce the above copyright
1282ed18acSAlfred Perlstein.\"    notice(s), this list of conditions and the following disclaimer in the
1382ed18acSAlfred Perlstein.\"    documentation and/or other materials provided with the distribution.
1482ed18acSAlfred Perlstein.\"
1582ed18acSAlfred Perlstein.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
1682ed18acSAlfred Perlstein.\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
1782ed18acSAlfred Perlstein.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
1882ed18acSAlfred Perlstein.\" DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
1982ed18acSAlfred Perlstein.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
2082ed18acSAlfred Perlstein.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
2182ed18acSAlfred Perlstein.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
2282ed18acSAlfred Perlstein.\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2382ed18acSAlfred Perlstein.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2482ed18acSAlfred Perlstein.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
2582ed18acSAlfred Perlstein.\" DAMAGE.
2682ed18acSAlfred Perlstein.\"
2782ed18acSAlfred Perlstein.Dd July 9, 2001
2882ed18acSAlfred Perlstein.Dt BUF_LOCK 9
2982ed18acSAlfred Perlstein.Os
3082ed18acSAlfred Perlstein.Sh NAME
3182ed18acSAlfred Perlstein.Nm BUF_LOCK
324bc6a387SRuslan Ermilov.Nd "locks a buffer"
3382ed18acSAlfred Perlstein.Sh SYNOPSIS
344bc6a387SRuslan Ermilov.In sys/param.h
35f16b3c0dSChad David.In sys/systm.h
36f16b3c0dSChad David.In sys/uio.h
37f16b3c0dSChad David.In sys/bio.h
384bc6a387SRuslan Ermilov.In sys/buf.h
3982ed18acSAlfred Perlstein.Ft int
400ef36920SAlfred Perlstein.Fn BUF_LOCK "struct buf *bp" "int locktype"
4182ed18acSAlfred Perlstein.Sh DESCRIPTION
4282ed18acSAlfred PerlsteinThe
434bc6a387SRuslan Ermilov.Fn BUF_LOCK
444bc6a387SRuslan Ermilovfunction locks the given buffer.
454bc6a387SRuslan ErmilovIf the lock is already held this
4660f79c3cSRuslan Ermilovcall will block until it can acquire the lock unless
474bc6a387SRuslan Ermilov.Dv LK_NOWAIT
484bc6a387SRuslan Ermilovis set.
4982ed18acSAlfred Perlstein.Pp
5082ed18acSAlfred PerlsteinIts arguments are:
51e8b02a42SRuslan Ermilov.Bl -tag -width ".Fa locktype"
524bc6a387SRuslan Ermilov.It Fa bp
5382ed18acSAlfred PerlsteinThe buffer to lock.
544bc6a387SRuslan Ermilov.It Fa locktype
554bc6a387SRuslan ErmilovFlags controlling the type of lock.
564bc6a387SRuslan ErmilovSee
574bc6a387SRuslan Ermilov.Xr lockmgr 9
584bc6a387SRuslan Ermilovfor details.
5982ed18acSAlfred Perlstein.El
6082ed18acSAlfred Perlstein.Sh RETURN VALUES
614bc6a387SRuslan ErmilovA value of 0 is returned upon success.
624bc6a387SRuslan ErmilovSee
634bc6a387SRuslan Ermilov.Xr lockmgr 9
644bc6a387SRuslan Ermilovfor
6582ed18acSAlfred Perlsteininformation on non-zero return values.
6682ed18acSAlfred Perlstein.Sh SEE ALSO
674bc6a387SRuslan Ermilov.Xr buf 9 ,
684bc6a387SRuslan Ermilov.Xr BUF_TIMELOCK 9 ,
694bc6a387SRuslan Ermilov.Xr BUF_UNLOCK 9 ,
7082ed18acSAlfred Perlstein.Xr lockmgr 9
7182ed18acSAlfred Perlstein.Sh AUTHORS
72571dba6eSHiten PandyaThis manual page was written by
73*8a7314fcSBaptiste Daroussin.An Chad David Aq Mt davidc@acns.ab.ca .
74