summaryrefslogtreecommitdiff
path: root/sys/vm
diff options
context:
space:
mode:
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_map.c4
-rw-r--r--sys/vm/vm_obj.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index afe6760..2501e08 100644
--- a/sys/vm/vm_map.c
+++ b/sys/vm/vm_map.c
@@ -305,12 +305,12 @@ munmap(void *addr, size_t len)
spinlock_acquire(&obj->lock);
/*
* Drop our ref and try to cleanup. If the refcount
- * is > 1, something is still holding it and we can't
+ * is > 0, something is still holding it and we can't
* do much.
*/
vm_object_unref(obj);
vp = obj->vnode;
- if (vp != NULL && obj->ref == 1) {
+ if (vp != NULL && obj->ref == 0) {
vp->vmobj = NULL;
vm_obj_destroy(obj);
}
diff --git a/sys/vm/vm_obj.c b/sys/vm/vm_obj.c
index 8f34ff3..6dbe777 100644
--- a/sys/vm/vm_obj.c
+++ b/sys/vm/vm_obj.c
@@ -61,7 +61,7 @@ vm_obj_init(struct vm_object **res, struct vnode *vnode)
memset(obj, 0, sizeof(struct vm_object));
obj->vnode = vnode;
- obj->ref = 1;
+ obj->ref = 0;
vm_set_pgops(obj, vnode);
*res = obj;