diff options
author | kib <kib@FreeBSD.org> | 2012-08-04 18:16:43 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2012-08-04 18:16:43 +0000 |
commit | 4259905d3171a4cdd087436ff1c17eed74830b60 (patch) | |
tree | 6ac153a747b185932191fda117e5d5ee749c7fd6 /sys/vm/vnode_pager.c | |
parent | 92640c3632022e41b9cbf19c91dc943056036413 (diff) | |
download | FreeBSD-src-4259905d3171a4cdd087436ff1c17eed74830b60.zip FreeBSD-src-4259905d3171a4cdd087436ff1c17eed74830b60.tar.gz |
Reduce code duplication and exposure of direct access to struct
vm_page oflags by providing helper function
vm_page_readahead_finish(), which handles completed reads for pages
with indexes other then the requested one, for VOP_GETPAGES().
Reviewed by: alc
MFC after: 1 week
Diffstat (limited to 'sys/vm/vnode_pager.c')
-rw-r--r-- | sys/vm/vnode_pager.c | 33 |
1 files changed, 2 insertions, 31 deletions
diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c index 9c12be1..b51a500 100644 --- a/sys/vm/vnode_pager.c +++ b/sys/vm/vnode_pager.c @@ -985,37 +985,8 @@ vnode_pager_generic_getpages(vp, m, bytecount, reqpage) mt)); } - if (i != reqpage) { - - /* - * whether or not to leave the page activated is up in - * the air, but we should put the page on a page queue - * somewhere. (it already is in the object). Result: - * It appears that empirical results show that - * deactivating pages is best. - */ - - /* - * just in case someone was asking for this page we - * now tell them that it is ok to use - */ - if (!error) { - if (mt->oflags & VPO_WANTED) { - vm_page_lock(mt); - vm_page_activate(mt); - vm_page_unlock(mt); - } else { - vm_page_lock(mt); - vm_page_deactivate(mt); - vm_page_unlock(mt); - } - vm_page_wakeup(mt); - } else { - vm_page_lock(mt); - vm_page_free(mt); - vm_page_unlock(mt); - } - } + if (i != reqpage) + vm_page_readahead_finish(mt, error); } VM_OBJECT_UNLOCK(object); if (error) { |