vrele((struct vnode *)uobj);
struct uvm_vnode *uvn; struct vnode *vp; int oldflags; UVMHIST_FUNC("uvn_detach"); UVMHIST_CALLED(maphist);  simple_lock(&uobj->vmobjlock);  UVMHIST_LOG(maphist,"  (uobj=0x%x)  ref=%d", uobj,uobj->uo_refs,0,0); uobj->uo_refs--;			 if (uobj->uo_refs) {			 simple_unlock(&uobj->vmobjlock); UVMHIST_LOG(maphist, "<- done (rc>0)", 0,0,0,0); return; }    uvn = (struct uvm_vnode *) uobj; vp = (struct vnode *) uobj;   vp->v_flag &= ~VTEXT;    if (uvn->u_flags & UVM_VNODE_CANPERSIST) {  uvn_flush(uobj, 0, 0, PGO_DEACTIVATE|PGO_ALLPAGES); simple_unlock(&uobj->vmobjlock); vrele(vp);			 UVMHIST_LOG(maphist,"<- done/vrele!  (persist)", 0,0,0,0); return; }    UVMHIST_LOG(maphist,"  its a goner (flushing)!", 0,0,0,0);  uvn->u_flags |= UVM_VNODE_DYING;    (void) uvn_flush(uobj, 0, 0, PGO_CLEANIT|PGO_FREE|PGO_ALLPAGES);  UVMHIST_LOG(maphist,"  its a goner (done flush)!", 0,0,0,0);    if (uobj->uo_npages) {		 #ifdef DEBUG  printf("uvn_detach: vn %p has pages left after flush - " "relkill mode\n", uobj); #endif uvn->u_flags |= UVM_VNODE_RELKILL; simple_unlock(&uobj->vmobjlock); UVMHIST_LOG(maphist,"<- done! (releasepg will kill obj)", 0, 0, 0, 0); return; }   if (uvn->u_flags & UVM_VNODE_WRITEABLE) { simple_lock(&uvn_wl_lock);		 LIST_REMOVE(uvn, u_wlist); simple_unlock(&uvn_wl_lock); } #ifdef DIAGNOSTIC if (uobj->memq.tqh_first != NULL) panic("uvn_deref: vnode VM object still has pages afer " "syncio/free flush"); #endif oldflags = uvn->u_flags; uvn->u_flags = 0; simple_unlock(&uobj->vmobjlock);   if (oldflags & UVM_VNODE_WANTED) wakeup(uvn);   vrele(vp); UVMHIST_LOG(maphist,"<- done (vrele) final", 0,0,0,0);  return;
uvn_detach(uobj)	struct uvm_object *uobj;{	vrele((struct vnode *)uobj);}