return 0;
return(KERN_SUCCESS);
uvm_loan(map, start, len, result, flags)	struct vm_map *map;	vaddr_t start;	vsize_t len;	void **result;	int flags;{	struct uvm_faultinfo ufi;	void **output;	int rv, error;	/*	 * ensure that one and only one of the flags is set	 */	KASSERT(((flags & UVM_LOAN_TOANON) == 0) ^		((flags & UVM_LOAN_TOPAGE) == 0));	KASSERT((map->flags & VM_MAP_INTRSAFE) == 0);	/*	 * "output" is a pointer to the current place to put the loaned	 * page...	 */	output = &result[0];	/* start at the beginning ... */	/*	 * while we've got pages to do	 */	while (len > 0) {		/*		 * fill in params for a call to uvmfault_lookup		 */		ufi.orig_map = map;		ufi.orig_rvaddr = start;		ufi.orig_size = len;		/*		 * do the lookup, the only time this will fail is if we hit on		 * an unmapped region (an error)		 */		if (!uvmfault_lookup(&ufi, FALSE)) {			error = ENOENT;			goto fail;		}		/*		 * map now locked.  now do the loanout...		 */		rv = uvm_loanentry(&ufi, &output, flags);		if (rv < 0) {			/* all unlocked due to error */			error = EINVAL;			goto fail;		}		/*		 * done!  the map is unlocked.  advance, if possible.		 *		 * XXXCDC: could be recoded to hold the map lock with 		 *	   smarter code (but it only happens on map entry 		 *	   boundaries, so it isn't that bad).		 */		if (rv) {			rv <<= PAGE_SHIFT;			len -= rv;			start += rv;		}	}	/*	 * got it!   return success.	 */	return 0;fail:	/*	 * fail: failed to do it.   drop our loans and return failure code.	 * map is already unlocked.	 */	if (output - result) {		if (flags & UVM_LOAN_TOANON)			uvm_unloananon((struct vm_anon **)result,			    output - result);		else			uvm_unloanpage((struct vm_page **)result,			    output - result);	}	return (error);}