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.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index 38e0519..684fdf4 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -174,7 +174,7 @@ vm_object_zdtor(void *mem, int size, void *arg)
("object %p has reservations",
object));
#endif
- KASSERT(object->cache == NULL,
+ KASSERT(vm_object_cache_is_empty(object),
("object %p has cached pages",
object));
KASSERT(object->paging_in_progress == 0,
@@ -753,7 +753,7 @@ vm_object_terminate(vm_object_t object)
if (__predict_false(!LIST_EMPTY(&object->rvq)))
vm_reserv_break_all(object);
#endif
- if (__predict_false(object->cache != NULL))
+ if (__predict_false(!vm_object_cache_is_empty(object)))
vm_page_cache_free(object, 0, 0);
/*
@@ -1378,7 +1378,7 @@ retry:
* should still be OBJT_DEFAULT and orig_object should not
* contain any cached pages within the specified range.
*/
- if (__predict_false(orig_object->cache != NULL))
+ if (__predict_false(!vm_object_cache_is_empty(orig_object)))
vm_page_cache_transfer(orig_object, offidxstart,
new_object);
}
@@ -1727,7 +1727,8 @@ vm_object_collapse(vm_object_t object)
/*
* Free any cached pages from backing_object.
*/
- if (__predict_false(backing_object->cache != NULL))
+ if (__predict_false(
+ !vm_object_cache_is_empty(backing_object)))
vm_page_cache_free(backing_object, 0, 0);
}
/*
@@ -1921,7 +1922,7 @@ again:
}
vm_object_pip_wakeup(object);
skipmemq:
- if (__predict_false(object->cache != NULL))
+ if (__predict_false(!vm_object_cache_is_empty(object)))
vm_page_cache_free(object, start, end);
}
OpenPOWER on IntegriCloud