diff options
author | attilio <attilio@FreeBSD.org> | 2013-02-06 14:50:34 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2013-02-06 14:50:34 +0000 |
commit | 9d88c5279c7cb30922a3370e680f7cb67cd3b7d0 (patch) | |
tree | 1d3acdb88e18f4fe03323f9b9ea67068ab126d82 /sys/vm/vm_page.c | |
parent | 44f85cd1a56371dc6f7f850335babfad7495ff1c (diff) | |
download | FreeBSD-src-9d88c5279c7cb30922a3370e680f7cb67cd3b7d0.zip FreeBSD-src-9d88c5279c7cb30922a3370e680f7cb67cd3b7d0.tar.gz |
Now that vm_page_cache_free() and vm_page_cache_transfer() are
reimplemented as ranged operations, sync vm_page_is_cached() semantic
with HEAD.
Diffstat (limited to 'sys/vm/vm_page.c')
-rw-r--r-- | sys/vm/vm_page.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 02c7de1..742d741 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -1117,12 +1117,12 @@ vm_page_cache_transfer(vm_object_t orig_object, vm_pindex_t offidxstart, } /* - * Returns a pointer to the cached page associated with the given object - * and offset, NULL otherwise. + * Returns TRUE if a cached page is associated with the given object and + * offset, and FALSE otherwise. * * The object must be locked. */ -vm_page_t +boolean_t vm_page_is_cached(vm_object_t object, vm_pindex_t pindex) { vm_page_t m; @@ -1135,10 +1135,12 @@ vm_page_is_cached(vm_object_t object, vm_pindex_t pindex) * exist. */ VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); + if (vm_object_cache_is_empty(object)) + return (FALSE); mtx_lock(&vm_page_queue_free_mtx); m = vm_page_cache_lookup(object, pindex); mtx_unlock(&vm_page_queue_free_mtx); - return (m); + return (m != NULL); } /* |