1 .\" $NetBSD: ubc.9,v 1.2 2009/08/03 19:18:27 rmind Exp $
3 .\" Copyright (c) 1998 Matthew R. Green
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, 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 AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
20 .\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
22 .\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23 .\" 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
32 .Nd unified buffer cache
36 .Fn ubc_alloc "struct uvm_object *uobj" "voff_t offset" "vsize_t *lenp" \
37 "int advice" "int flags"
39 .Fn ubc_release "void *va" "int flags"
41 .Fn ubc_uiomove "struct uvm_object *uobj" "struct uio *uio" "vsize_t todo" "int advice" "int flags"
44 creates a kernel mapping of
48 The desired length of the mapping is pointed to by
50 but the actual mapping may be smaller than this.
52 is updated to contain the actual length mapped.
54 is the access pattern hint, which must be one of
56 .Bl -tag -offset indent -width "UVM_ADV_SEQUENTIAL" -compact
61 .It UVM_ADV_SEQUENTIAL
62 Sequential access hint (from lower offset to higher offset)
69 .Bl -tag -offset indent -width "UVM_ADV_SEQUENTIAL" -compact
71 Mapping will be accessed for read.
73 Mapping will be accessed for write.
75 Fault in window's pages already during mapping operation.
76 Makes sense only for write.
79 Once the mapping is created, it must be accessed only by methods that can
80 handle faults, such as
84 Page faults on the mapping will result in the object's pager
85 method being called to resolve the fault.
91 The mapping may be cached to speed future accesses to the same region
93 The flags can be any of
95 .Bl -tag -offset indent -width "UVM_ADV_SEQUENTIAL" -compact
101 allocates an UBC memory window, performs I/O on it and unmaps the window.
104 parameter takes the same values as the respective parameter in
108 parameter takes the same arguments as
112 Additionally, the flag
114 can be provided to indicate that it is acceptable to return if an error
117 This section describes places within the
119 source tree where actual code implementing the
123 All pathnames are relative to
128 subsystem is implemented within the file
129 .Pa sys/uvm/uvm_bio.c .
137 UBC first appeared in
142 designed and implemented the UBC part of UVM, which uses UVM pages
143 to cache vnode data rather than the traditional buffer cache buffers.