struct vnode *vp = (struct vnode *)uobj; struct proc *p = curproc; int error; UVMHIST_FUNC("uvn_get"); UVMHIST_CALLED(ubchist);  UVMHIST_LOG(ubchist, "vp %p off 0x%x", vp, (int)offset, 0,0); error = vn_lock(vp, LK_EXCLUSIVE|LK_RECURSEFAIL|LK_NOWAIT, p); if (error) { if (error == EBUSY) return EAGAIN; return error;
voff_t current_offset; struct vm_page *ptmp; int lcv, result, gotpages; boolean_t done; UVMHIST_FUNC("uvn_get"); UVMHIST_CALLED(maphist); UVMHIST_LOG(maphist, "flags=%d", flags,0,0,0);    if (flags & PGO_LOCKED) {    gotpages = 0;    done = TRUE;	  for (lcv = 0, current_offset = offset ; lcv < *npagesp ; lcv++, current_offset += PAGE_SIZE) {   if (pps[lcv] == PGO_DONTCARE) continue;   ptmp = uvm_pagelookup(uobj, current_offset);   if (ptmp == NULL || (ptmp->flags & (PG_BUSY|PG_RELEASED)) != 0) { if (lcv == centeridx || (flags & PGO_ALLPAGES) != 0) done = FALSE;	 continue; }   ptmp->flags |= PG_BUSY;		 UVM_PAGE_OWN(ptmp, "uvn_get1"); pps[lcv] = ptmp; gotpages++;  }	       *npagesp = gotpages;		 if (done) return(VM_PAGER_OK);		 else  return(VM_PAGER_UNLOCK);
uvn_get(uobj, offset, pps, npagesp, centeridx, access_type, advice, flags)	struct uvm_object *uobj;	voff_t offset;	struct vm_page **pps;		/* IN/OUT */	int *npagesp;			/* IN (OUT if PGO_LOCKED) */	int centeridx;	vm_prot_t access_type;	int advice, flags;{	struct vnode *vp = (struct vnode *)uobj;	struct proc *p = curproc;	int error;	UVMHIST_FUNC("uvn_get"); UVMHIST_CALLED(ubchist);	UVMHIST_LOG(ubchist, "vp %p off 0x%x", vp, (int)offset, 0,0);	error = vn_lock(vp, LK_EXCLUSIVE|LK_RECURSEFAIL|LK_NOWAIT, p);	if (error) {		if (error == EBUSY)			return EAGAIN;		return error;	}	error = VOP_GETPAGES(vp, offset, pps, npagesp, centeridx,		     access_type, advice, flags);	VOP_UNLOCK(vp, LK_RELEASE, p);	return error;}