Home Man
Today's Posts

Linux & Unix Commands - Search Man Pages
Man Page or Keyword Search:
Select Section of Man Page:
Select Man Page Repository:

NetBSD 6.1.5 - man page for ubc_alloc (netbsd section 9)

UBC(9)				  BSD Kernel Developer's Manual 			   UBC(9)

     ubc -- unified buffer cache

     #include <uvm/uvm.h>

     void *
     ubc_alloc(struct uvm_object *uobj, voff_t offset, vsize_t *lenp, int advice, int flags);

     ubc_release(void *va, int flags);

     ubc_uiomove(struct uvm_object *uobj, struct uio *uio, vsize_t todo, int advice, int flags);

     ubc_purge(struct uvm_object *uobj);

     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_NORMAL      No hint
	   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.

     ubc_purge() disassociates all UBC structures from an empty UVM object, specified by uobj.

     The ubc subsystem is implemented within the file sys/uvm/uvm_bio.c.

     pmap(9), uiomove(9), uvm(9), vnode(9), vnodeops(9)

     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, http://www.usenix.org/event/usenix2000/freenix/full_papers/silvers/silvers.pdf,
     285-290, June 18-23, 2000.

     UBC first appeared in NetBSD 1.6.

     Chuck Silvers <chuq@chuq.com> designed and implemented the UBC part of UVM, which uses UVM
     pages to cache vnode data rather than the traditional buffer cache buffers.

BSD					  June 14, 2011 				      BSD

All times are GMT -4. The time now is 10:40 AM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.
Show Password

Not a Forum Member?
Forgot Password?