summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vnode_pager.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c
index 40e75d9..4758456 100644
--- a/sys/vm/vnode_pager.c
+++ b/sys/vm/vnode_pager.c
@@ -225,20 +225,21 @@ retry:
object->handle = handle;
if (VFS_NEEDSGIANT(vp->v_mount))
vm_object_set_flag(object, OBJ_NEEDGIANT);
- VM_OBJECT_LOCK(object);
- if ( vp->v_object != NULL) {
+ VI_LOCK(vp);
+ if (vp->v_object != NULL) {
/*
* Object has been created while we were sleeping
*/
- VM_OBJECT_UNLOCK(object);
+ VI_UNLOCK(vp);
vm_object_destroy(object);
goto retry;
}
vp->v_object = object;
- } else
+ VI_UNLOCK(vp);
+ } else {
object->ref_count++;
-
- VM_OBJECT_UNLOCK(object);
+ VM_OBJECT_UNLOCK(object);
+ }
vref(vp);
return (object);
}
OpenPOWER on IntegriCloud