UBC(9) | Kernel Developer's Manual | UBC(9) |
void *
ubc_alloc(struct uvm_object *uobj, voff_t offset, vsize_t *lenp, int advice, int flags);
void
ubc_release(void *va, int flags);
int
ubc_uiomove(struct uvm_object *uobj, struct uio *uio, vsize_t todo, int advice, int flags);
void
ubc_purge(struct uvm_object *uobj);
The possible flags are
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_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.
ubc_purge() disassociates all UBC structures from an empty UVM object, specified by uobj.
Chuck Silvers, UBC: An Efficient Unified I/O and Memory Caching Subsystem for NetBSD, Proceedings of the FREENIX Track: 2000 USENIX Annual Technical Conference, USENIX Association, 285-290, June 18-23, 2000, http://www.usenix.org/event/usenix2000/freenix/full_papers/silvers/silvers.pdf.
June 14, 2011 | NetBSD 6.1 |