summaryrefslogtreecommitdiffstats
path: root/sys/vm
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
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')
-rw-r--r--sys/vm/vm_object.c14
-rw-r--r--sys/vm/vm_object.h3
-rw-r--r--sys/vm/vnode_pager.c4
3 files changed, 14 insertions, 7 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
diff --git a/sys/vm/vm_object.h b/sys/vm/vm_object.h
index 4cf72cb..4484da6 100644
--- a/sys/vm/vm_object.h
+++ b/sys/vm/vm_object.h
@@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_object.h,v 1.27 1996/03/02 02:54:23 dyson Exp $
+ * $Id: vm_object.h,v 1.28 1996/05/19 07:36:50 dyson Exp $
*/
/*
@@ -130,6 +130,7 @@ struct vm_object {
#define OBJ_WRITEABLE 0x0080 /* object has been made writable */
#define OBJ_MIGHTBEDIRTY 0x0100 /* object might be dirty */
#define OBJ_CLEANING 0x0200
+#define OBJ_VFS_REF 0x0400 /* object is refed by vfs layer */
#define OBJ_NORMAL 0x0 /* default behavior */
diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c
index 3c9d21a..e2c33f9 100644
--- a/sys/vm/vnode_pager.c
+++ b/sys/vm/vnode_pager.c
@@ -38,7 +38,7 @@
* SUCH DAMAGE.
*
* from: @(#)vnode_pager.c 7.5 (Berkeley) 4/20/91
- * $Id: vnode_pager.c,v 1.61 1996/07/27 03:24:10 dyson Exp $
+ * $Id: vnode_pager.c,v 1.62 1996/07/30 03:08:21 dyson Exp $
*/
/*
@@ -151,7 +151,7 @@ vnode_pager_alloc(handle, size, prot, offset)
/*
* Hold a reference to the vnode and initialize object data.
*/
- VREF(vp);
+ vp->v_usecount++;
object->un_pager.vnp.vnp_size = (vm_ooffset_t) size * PAGE_SIZE;
object->handle = handle;
OpenPOWER on IntegriCloud