Eliminate duplication of the pmap and pv list unlock operations in
pmap_enter() by implementing a single return path. Otherwise, the duplication will only increase with the upcoming support for psind == 1. Reviewed by: kib (some time ago)
This commit is contained in:
parent
e23ce9ef7a
commit
d118a00f3c
@ -4313,6 +4313,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
|
||||
pv_entry_t pv;
|
||||
vm_paddr_t opa, pa;
|
||||
vm_page_t mpte, om;
|
||||
int rv;
|
||||
boolean_t nosleep;
|
||||
|
||||
PG_A = pmap_accessed_bit(pmap);
|
||||
@ -4387,10 +4388,8 @@ retry:
|
||||
mpte = _pmap_allocpte(pmap, pmap_pde_pindex(va),
|
||||
nosleep ? NULL : &lock);
|
||||
if (mpte == NULL && nosleep) {
|
||||
if (lock != NULL)
|
||||
rw_wunlock(lock);
|
||||
PMAP_UNLOCK(pmap);
|
||||
return (KERN_RESOURCE_SHORTAGE);
|
||||
rv = KERN_RESOURCE_SHORTAGE;
|
||||
goto out;
|
||||
}
|
||||
goto retry;
|
||||
} else
|
||||
@ -4516,10 +4515,12 @@ unchanged:
|
||||
vm_reserv_level_iffullpop(m) == 0)
|
||||
pmap_promote_pde(pmap, pde, va, &lock);
|
||||
|
||||
rv = KERN_SUCCESS;
|
||||
out:
|
||||
if (lock != NULL)
|
||||
rw_wunlock(lock);
|
||||
PMAP_UNLOCK(pmap);
|
||||
return (KERN_SUCCESS);
|
||||
return (rv);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user