summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_object.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/vm/vm_object.c')
-rw-r--r--sys/vm/vm_object.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index 496da96..c168b3b 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_object.c,v 1.77 1996/07/27 03:24:03 dyson Exp $
+ * $Id: vm_object.c,v 1.78 1996/07/30 03:08:14 dyson Exp $
*/
/*
@@ -231,7 +231,7 @@ vm_object_allocate(type, size)
*
* Gets another reference to the given object.
*/
-inline void
+void
vm_object_reference(object)
register vm_object_t object;
{
@@ -332,7 +332,9 @@ vm_object_deallocate(object)
*/
if (object->flags & OBJ_CANPERSIST) {
if (object->resident_page_count != 0) {
+#if 0
vm_object_page_clean(object, 0, 0 ,TRUE, TRUE);
+#endif
TAILQ_INSERT_TAIL(&vm_object_cached_list, object,
cached_list);
vm_object_cached++;
@@ -392,11 +394,15 @@ vm_object_terminate(object)
*/
if (object->type == OBJT_VNODE) {
struct vnode *vp = object->handle;
+ int waslocked;
- VOP_LOCK(vp);
+ waslocked = VOP_ISLOCKED(vp);
+ if (!waslocked)
+ VOP_LOCK(vp);
vm_object_page_clean(object, 0, 0, TRUE, FALSE);
vinvalbuf(vp, V_SAVE, NOCRED, NULL, 0, 0);
- VOP_UNLOCK(vp);
+ if (!waslocked)
+ VOP_UNLOCK(vp);
}
/*
* Now free the pages. For internal objects, this also removes them
OpenPOWER on IntegriCloud