FreeBSD/sys/kern/vfs_bio.c
/*
 * Unwire a page held by a buf and place it on the appropriate vm queue.
 */
Unwire a page held by a buf and place it on the appropriate vm queue.
Unwire a page held by a buf and place it on the appropriate vm queue .
static void
vfs_vmio_unwire(struct buf *bp, vm_page_t m)
{
	bool freed;
	vm_page_lock(m);
	if (vm_page_unwire(m, PQ_NONE)) {
		if (m->valid == 0) {
			freed = !vm_page_busied(m);
			if (freed)
				vm_page_free(m);
		} else if ((bp->b_flags & B_DIRECT) != 0)
			freed = vm_page_try_to_free(m);
		else
			freed = false;
		if (!freed) {
			if ((bp->b_flags & B_NOREUSE) != 0)
				vm_page_deactivate_noreuse(m);
			else
				vm_page_deactivate(m);
		}
	}
	vm_page_unlock(m);
}
static void vfs_vmio_unwire ( struct buf * bp , vm_page_t m ) { bool freed ; vm_page_lock ( m ) ; if ( vm_page_unwire ( m , PQ_NONE ) ) { if ( m -> valid == 0 ) { freed = ! vm_page_busied ( m ) ; if ( freed ) vm_page_free ( m ) ; } else if ( ( bp -> b_flags & B_DIRECT ) != 0 ) freed = vm_page_try_to_free ( m ) ; else freed = false ; if ( ! freed ) { if ( ( bp -> b_flags & B_NOREUSE ) != 0 ) vm_page_deactivate_noreuse ( m ) ; else vm_page_deactivate ( m ) ; } } vm_page_unlock ( m ) ; }
Unwire a page held by a buf and place it on the appropriate vm queue.
Unwire a page held by a buf and place it on the appropriate vm queue .
/*
		 * Determine if the page should be freed before adding
		 * it to the inactive queue.
		 */ /*
			 * If the page is unlikely to be reused, let the
			 * VM know.  Otherwise, maintain LRU page
			 * ordering and put the page at the tail of the
			 * inactive queue.
			 */