summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_object.c
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1996-08-21 21:56:23 +0000
committerdyson <dyson@FreeBSD.org>1996-08-21 21:56:23 +0000
commit966cbc5d29e66792108ec7d19f731b46d171245b (patch)
tree07a76a1b97882ad9c1e3805d05f820bc976c60bd /sys/vm/vm_object.c
parent2d0ae2fc91a319615c14ec10da1161bab780f734 (diff)
downloadFreeBSD-src-966cbc5d29e66792108ec7d19f731b46d171245b.zip
FreeBSD-src-966cbc5d29e66792108ec7d19f731b46d171245b.tar.gz
Even though this looks like it, this is not a complex code change.
The interface into the "VMIO" system has changed to be more consistant and robust. Essentially, it is now no longer necessary to call vn_open to get merged VM/Buffer cache operation, and exceptional conditions such as merged operation of VBLK devices is simpler and more correct. This code corrects a potentially large set of problems including the problems with ktrace output and loaded systems, file create/deletes, etc. Most of the changes to NFS are cosmetic and name changes, eliminating a layer of subroutine calls. The direct calls to vput/vrele have been re-instituted for better cross platform compatibility. Reviewed by: davidg
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