ubc_alloc() creates a kernel mapping of
uobj starting at offset
offset. The desired length of the mapping is pointed to by
lenp, but the actual mapping may be smaller than this.
lenp is updated to contain the actual length mapped.
advice is the access pattern hint, which must be one of
UVM_ADV_RANDOM
Random access hint
UVM_ADV_SEQUENTIAL
Sequential access hint (from lower offset to higher offset)
The possible
flags are
UBC_READ
Mapping will be accessed for read.
UBC_WRITE
Mapping will be accessed for write.
UBC_FAULTBUSY
Fault in window's pages already during mapping operation. Makes sense only for write.
Once the mapping is created, it must be accessed only by methods that can handle faults, such as
uiomove() or
kcopy(). Page faults on the mapping will result in the object's pager method being called to resolve the fault.
ubc_release() frees the mapping at
va for reuse. The mapping may be cached to speed future accesses to the same region of the object. The flags can be any of
UBC_UNMAP
Do not cache mapping.
ubc_uiomove() allocates an UBC memory window, performs I/O on it and unmaps the window. The
advice parameter takes the same values as the respective parameter in
ubc_alloc() and the
flags parameter takes the same arguments as
ubc_alloc() and
ubc_release(). Additionally, the flag
UBC_PARTIALOK can be provided to indicate that it is acceptable to return if an error occurs mid-transfer.