This commit is contained in:
mrg 1997-02-05 07:48:42 +00:00
parent 6d39698236
commit 85328f7b35
1 changed files with 440 additions and 444 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_object.c,v 1.37 1997/01/03 18:03:29 mrg Exp $ */
/* $NetBSD: vm_object.c,v 1.38 1997/02/05 07:48:42 mrg Exp $ */
/*
* Copyright (c) 1991, 1993
@ -316,8 +316,8 @@ vm_object_deallocate(object)
vm_object_cache_unlock();
temp = object->shadow;
vm_object_terminate(object);
/* unlocks and deallocates object */
vm_object_terminate(object);
object = temp;
}
}
@ -752,7 +752,7 @@ vm_object_copy(src_object, src_offset, size,
if (!vm_object_lock_try(old_copy)) {
vm_object_unlock(src_object);
/* should spin a bit here... */
/* XXX should spin a bit here... */
vm_object_lock(src_object);
goto Retry1;
}
@ -816,15 +816,14 @@ vm_object_copy(src_object, src_offset, size,
* object. Locking of new_copy not needed. We
* have the only pointer.
*/
src_object->ref_count--; /* remove ref. from old_copy */
src_object->ref_count--;
vm_object_set_shadow(old_copy, new_copy);
new_copy->ref_count++; /* locking not needed - we
have the only pointer */
vm_object_unlock(old_copy); /* done with old_copy */
new_copy->ref_count++;
vm_object_unlock(old_copy);
}
new_start = (vm_offset_t) 0; /* always shadow original at 0 */
new_end = (vm_offset_t) new_copy->size; /* for the whole object */
new_start = (vm_offset_t)0;
new_end = (vm_offset_t)new_copy->size;
/*
* Point the new copy at the existing object.
@ -1031,7 +1030,6 @@ vm_object_remove(pager)
/*
* vm_object_cache_clear removes all objects from the cache.
*
*/
void
vm_object_cache_clear()
@ -1523,7 +1521,8 @@ vm_object_bypass(object)
if (backing_object->copy == object)
backing_object->copy = NULL;
/* Drop the reference count on backing_object.
/*
* Drop the reference count on backing_object.
* Since its ref_count was at least 2, it
* will not vanish; so we don't need to call
* vm_object_deallocate.
@ -1531,6 +1530,7 @@ vm_object_bypass(object)
backing_object->ref_count--;
vm_object_unlock(backing_object);
object_bypasses++;
return KERN_SUCCESS;
}
@ -1566,7 +1566,7 @@ vm_object_collapse(object)
return;
/*
* There is a backing object, and
* There is a backing object, and ...
*/
if ((backing_object = object->shadow) == NULL)
@ -1574,8 +1574,7 @@ vm_object_collapse(object)
vm_object_lock(backing_object);
/*
* ...
* The backing object is not read_only,
* ... the backing object is not read_only,
* and no pages in the backing object are
* currently being paged out.
* The backing object is internal.
@ -1679,10 +1678,8 @@ vm_object_page_remove(object, start, end)
* The object must *not* be locked.
*/
boolean_t
vm_object_coalesce(prev_object, next_object,
prev_offset, next_offset,
vm_object_coalesce(prev_object, next_object, prev_offset, next_offset,
prev_size, next_size)
register vm_object_t prev_object;
vm_object_t next_object;
vm_offset_t prev_offset, next_offset;
@ -1732,8 +1729,7 @@ vm_object_coalesce(prev_object, next_object,
* a previous deallocation.
*/
vm_object_page_remove(prev_object,
prev_offset + prev_size,
vm_object_page_remove(prev_object, prev_offset + prev_size,
prev_offset + prev_size + next_size);
/*