FreeBSD/sys/kern/vfs_bio.c
/*
 * Free the io map PTEs associated with this IO operation.
 * We also invalidate the TLB entries and restore the original b_addr.
 *
 * This function only works with pager buffers.
 */
Free the io map PTEs associated with this IO operation.
We also invalidate the TLB entries and restore the original b_addr.

This function only works with pager buffers.
Free the io map PTEs associated with this IO operation . We also invalidate the TLB entries and restore the original b_addr . This function only works with pager buffers .
void
vunmapbuf(struct buf *bp)
{
	int npages;
	npages = bp->b_npages;
	if (buf_mapped(bp))
		pmap_qremove(trunc_page((vm_offset_t)bp->b_data), npages);
	vm_page_unhold_pages(bp->b_pages, npages);
	bp->b_data = unmapped_buf;
}
void vunmapbuf ( struct buf * bp ) { int npages ; npages = bp -> b_npages ; if ( buf_mapped ( bp ) ) pmap_qremove ( trunc_page ( ( vm_offset_t ) bp -> b_data ) , npages ) ; vm_page_unhold_pages ( bp -> b_pages , npages ) ; bp -> b_data = unmapped_buf ; }
Free the io map PTEs associated with this IO operation.
Free the io map PTEs associated with this IO operation .