diff options
Diffstat (limited to 'sys/uvm/uvm_aobj.c')
-rw-r--r-- | sys/uvm/uvm_aobj.c | 35 |
1 files changed, 5 insertions, 30 deletions
diff --git a/sys/uvm/uvm_aobj.c b/sys/uvm/uvm_aobj.c index 33e2cb432ab..6ff2abee482 100644 --- a/sys/uvm/uvm_aobj.c +++ b/sys/uvm/uvm_aobj.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_aobj.c,v 1.110 2024/04/13 23:44:11 jsg Exp $ */ +/* $OpenBSD: uvm_aobj.c,v 1.111 2024/11/27 10:41:38 mpi Exp $ */ /* $NetBSD: uvm_aobj.c,v 1.39 2001/02/18 21:19:08 chs Exp $ */ /* @@ -1012,7 +1012,6 @@ uao_get(struct uvm_object *uobj, voff_t offset, struct vm_page **pps, * this if the data structures are locked (i.e. the first * time through). */ - done = TRUE; /* be optimistic */ gotpages = 0; /* # of pages we got so far */ @@ -1022,35 +1021,17 @@ uao_get(struct uvm_object *uobj, voff_t offset, struct vm_page **pps, if (pps[lcv] == PGO_DONTCARE) continue; + /* lookup page */ ptmp = uvm_pagelookup(uobj, current_offset); /* - * if page is new, attempt to allocate the page, - * zero-fill'd. - */ - if (ptmp == NULL && uao_find_swslot(uobj, - current_offset >> PAGE_SHIFT) == 0) { - ptmp = uvm_pagealloc(uobj, current_offset, - NULL, UVM_PGA_ZERO); - if (ptmp) { - /* new page */ - atomic_clearbits_int(&ptmp->pg_flags, - PG_BUSY|PG_FAKE); - atomic_setbits_int(&ptmp->pg_flags, - PQ_AOBJ); - UVM_PAGE_OWN(ptmp, NULL); - } - } - - /* * to be useful must get a non-busy page */ - if (ptmp == NULL || - (ptmp->pg_flags & PG_BUSY) != 0) { + if (ptmp == NULL || (ptmp->pg_flags & PG_BUSY) != 0) { if (lcv == centeridx || (flags & PGO_ALLPAGES) != 0) /* need to do a wait or I/O! */ - done = FALSE; + done = FALSE; continue; } @@ -1061,7 +1042,6 @@ uao_get(struct uvm_object *uobj, voff_t offset, struct vm_page **pps, UVM_PAGE_OWN(ptmp, "uao_get1"); pps[lcv] = ptmp; gotpages++; - } /* @@ -1069,12 +1049,7 @@ uao_get(struct uvm_object *uobj, voff_t offset, struct vm_page **pps, * to unlock and do some waiting or I/O. */ *npagesp = gotpages; - if (done) - /* bingo! */ - return VM_PAGER_OK; - else - /* EEK! Need to unlock and I/O */ - return VM_PAGER_UNLOCK; + return done ? VM_PAGER_OK : VM_PAGER_UNLOCK; } /* |