summaryrefslogtreecommitdiff
path: root/sys/uvm/uvm_pager.c
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2011-04-15 21:47:25 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2011-04-15 21:47:25 +0000
commitc5ddad9464398d4ade3321a300801dc031b0f224 (patch)
tree1746a60169c2b5f65815b439558d7c5be3bd53e0 /sys/uvm/uvm_pager.c
parent59923c29825f41832e3d6363d04c0e3f0c1b416d (diff)
move uvm_pageratop from uvm_pager.c local to a general uvm function
(uvm_atopg) and use it in uvm_km_doputpage to replace some handrolled code. Shrinks the kernel a trivial amount. ok beck@ and miod@ (who suggested i name it uvm_atopg not uvm_atop)
Diffstat (limited to 'sys/uvm/uvm_pager.c')
-rw-r--r--sys/uvm/uvm_pager.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/sys/uvm/uvm_pager.c b/sys/uvm/uvm_pager.c
index f634caecc96..8247ad51aec 100644
--- a/sys/uvm/uvm_pager.c
+++ b/sys/uvm/uvm_pager.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_pager.c,v 1.57 2010/07/24 15:40:39 kettenis Exp $ */
+/* $OpenBSD: uvm_pager.c,v 1.58 2011/04/15 21:47:24 oga Exp $ */
/* $NetBSD: uvm_pager.c,v 1.36 2000/11/27 18:26:41 chs Exp $ */
/*
@@ -91,8 +91,6 @@ void uvm_pseg_init(struct uvm_pseg *);
vaddr_t uvm_pseg_get(int);
void uvm_pseg_release(vaddr_t);
-struct vm_page *uvm_pageratop(vaddr_t);
-
/*
* uvm_pager_init: init pagers (at boot time)
*/
@@ -830,7 +828,7 @@ uvm_aio_aiodone(struct buf *bp)
uobj = NULL;
for (i = 0; i < npages; i++) {
- pgs[i] = uvm_pageratop((vaddr_t)bp->b_data + (i << PAGE_SHIFT));
+ pgs[i] = uvm_atopg((vaddr_t)bp->b_data + (i << PAGE_SHIFT));
UVMHIST_LOG(pdhist, "pgs[%ld] = %p", i, pgs[i],0,0);
}
uvm_pagermapout((vaddr_t)bp->b_data, npages);
@@ -905,21 +903,3 @@ freed:
}
pool_put(&bufpool, bp);
}
-
-/*
- * uvm_pageratop: convert KVAs in the pager map back to their page
- * structures.
- */
-struct vm_page *
-uvm_pageratop(vaddr_t kva)
-{
- struct vm_page *pg;
- paddr_t pa;
- boolean_t rv;
-
- rv = pmap_extract(pmap_kernel(), kva, &pa);
- KASSERT(rv);
- pg = PHYS_TO_VM_PAGE(pa);
- KASSERT(pg != NULL);
- return (pg);
-}