2 .\" Copyright (C) 2001 Chad David <davidc@acns.ab.ca>. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice(s), this list of conditions and the following disclaimer as
9 .\" the first lines of this file unmodified other than the possible
10 .\" addition of one or more copyright notices.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice(s), this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
15 .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
16 .\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 .\" DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
19 .\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 .\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21 .\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22 .\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
37 .Nd "functions for managing physical buffers"
44 .Fn getpbuf "int *pfreecnt"
46 .Fn trypbuf "int *pfreecnt"
48 .Fn relpbuf "struct buf *bp" "int *pfreecnt"
50 These functions are used to allocate and release physical buffers.
52 The physical buffers are allocated at system startup and are
53 maintained in a separate pool from the main system buffers.
54 They are intended for use by subsystems that cannot or should not be
55 reliant on the main pool of buffers (for example the swap pager).
56 The system allocates between 16 and 256 physical buffers depending
57 on the amount of memory in the system.
59 Each subsystem that allocates buffers via these calls is expected
60 to manage its own percentage free counter.
61 If the value is initialized to \-1 the number of buffers available
62 to the subsystem is limited only by the number of physical buffers
64 The number of buffers is stored in
70 A recommended initialization value is 1/2
75 function returns the first available buffer to the user.
76 If there are no buffers available,
78 will sleep waiting for one to become available.
83 will sleep until it increases.
85 is decremented prior to returning.
89 function returns the first available buffer.
90 If there are no buffers available,
99 is decremented prior to returning a valid buffer.
108 function releases the buffer back to the free list.
120 is incremented prior to returning.
125 return a pointer to the buffer.
129 can also be returned indicating that there are no buffers available.
131 This manual page was written by
132 .An Chad David Aq davidc@acns.ab.ca .