if (result != 0) {
if (result != VM_PAGER_OK) {
uvm_loananon(ufi, output, flags, anon)	struct uvm_faultinfo *ufi;	void ***output;	int flags;	struct vm_anon *anon;{	struct vm_page *pg;	int result;	/*	 * if we are loaning to "another" anon then it is easy, we just	 * bump the reference count on the current anon and return a	 * pointer to it (it becomes copy-on-write shared).	 */	if (flags & UVM_LOAN_TOANON) {		simple_lock(&anon->an_lock);		pg = anon->u.an_page;		/* if (in RAM) and (owned by this anon) and (only 1 ref) */		if (pg && (pg->pqflags & PQ_ANON) != 0 && anon->an_ref == 1)			/* write-protect it */			pmap_page_protect(pg, VM_PROT_READ);		anon->an_ref++;		**output = anon;		*output = (*output) + 1;		simple_unlock(&anon->an_lock);		return(1);	}	/*	 * we are loaning to a kernel-page.   we need to get the page	 * resident so we can wire it.   uvmfault_anonget will handle	 * this for us.	 */	simple_lock(&anon->an_lock);	result = uvmfault_anonget(ufi, ufi->entry->aref.ar_amap, anon);	/*	 * if we were unable to get the anon, then uvmfault_anonget has	 * unlocked everything and returned an error code.	 */	if (result != 0) {		/* need to refault (i.e. refresh our lookup) ? */		if (result == ERESTART)			return(0);		/* "try again"?   sleep a bit and retry ... */		if (result == EAGAIN) {			tsleep(&lbolt, PVM, "loanagain", 0);			return(0);		}		/* otherwise flag it as an error */		return(-1);	}	/*	 * we have the page and its owner locked: do the loan now.	 */	pg = anon->u.an_page;	uvm_lock_pageq();	if (pg->loan_count == 0)		pmap_page_protect(pg, VM_PROT_READ);	pg->loan_count++;	uvm_pagewire(pg);	/* always wire it */	uvm_unlock_pageq();	**output = pg;	*output = (*output) + 1;	/* unlock anon and return success */	if (pg->uobject)	/* XXXCDC: what if this is our uobj? bad */		simple_unlock(&pg->uobject->vmobjlock);	simple_unlock(&anon->an_lock);	return(1);}