diff options
author | alc <alc@FreeBSD.org> | 2003-05-04 19:23:40 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2003-05-04 19:23:40 +0000 |
commit | 65684800f05f3910147a2ddb35a28eb7c9f79109 (patch) | |
tree | 841b05cf74db249b04ab33624fd6f8367dd26e40 /sys/vm | |
parent | eb7e0cd5d2da6929f882f01b1e783b01085ae8f2 (diff) | |
download | FreeBSD-src-65684800f05f3910147a2ddb35a28eb7c9f79109.zip FreeBSD-src-65684800f05f3910147a2ddb35a28eb7c9f79109.tar.gz |
Extend the scope of the vm_object lock in vm_object_terminate().
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/vm_object.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 3c7a239..dc33f00 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -552,7 +552,6 @@ vm_object_terminate(vm_object_t object) * wait for the pageout daemon to be done with the object */ vm_object_pip_wait(object, "objtrm"); - VM_OBJECT_UNLOCK(object); KASSERT(!object->paging_in_progress, ("vm_object_terminate: pageout in progress")); @@ -562,17 +561,17 @@ vm_object_terminate(vm_object_t object) * object are gone, so we don't need to lock it. */ if (object->type == OBJT_VNODE) { - struct vnode *vp; + struct vnode *vp = (struct vnode *)object->handle; /* * Clean pages and flush buffers. */ - VM_OBJECT_LOCK(object); vm_object_page_clean(object, 0, 0, OBJPC_SYNC); VM_OBJECT_UNLOCK(object); - vp = (struct vnode *) object->handle; vinvalbuf(vp, V_SAVE, NOCRED, NULL, 0, 0); + + VM_OBJECT_LOCK(object); } KASSERT(object->ref_count == 0, @@ -601,6 +600,7 @@ vm_object_terminate(vm_object_t object) } vm_page_unlock_queues(); splx(s); + VM_OBJECT_UNLOCK(object); /* * Let the pager know object is dead. |