1
0
mirror of https://github.com/openbsd/src.git synced 2024-12-21 23:18:00 -08:00

A shared lock is now enough to call pgo_get() functions iff PGO_LOCKED is given.

Update assertions to reflect that.

ok tb@, miod@
This commit is contained in:
mpi 2024-12-20 18:49:37 +00:00
parent dceff77413
commit f3e62b5987
2 changed files with 8 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $OpenBSD: uvm_aobj.c,v 1.112 2024/12/18 16:41:27 mpi Exp $ */
/* $OpenBSD: uvm_aobj.c,v 1.113 2024/12/20 18:49:37 mpi Exp $ */
/* $NetBSD: uvm_aobj.c,v 1.39 2001/02/18 21:19:08 chs Exp $ */
/*
@ -999,7 +999,9 @@ uao_get(struct uvm_object *uobj, voff_t offset, struct vm_page **pps,
boolean_t done;
KASSERT(UVM_OBJ_IS_AOBJ(uobj));
KASSERT(rw_write_held(uobj->vmobjlock));
KASSERT(rw_lock_held(uobj->vmobjlock));
KASSERT(rw_write_held(uobj->vmobjlock) ||
((flags & PGO_LOCKED) != 0 && (access_type & PROT_WRITE) == 0));
/*
* get number of pages

View File

@ -1,4 +1,4 @@
/* $OpenBSD: uvm_vnode.c,v 1.136 2024/12/18 16:41:27 mpi Exp $ */
/* $OpenBSD: uvm_vnode.c,v 1.137 2024/12/20 18:49:37 mpi Exp $ */
/* $NetBSD: uvm_vnode.c,v 1.36 2000/11/24 20:34:01 chs Exp $ */
/*
@ -950,8 +950,9 @@ uvn_get(struct uvm_object *uobj, voff_t offset, struct vm_page **pps,
int lcv, result, gotpages;
boolean_t done;
KASSERT(((flags & PGO_LOCKED) != 0 && rw_lock_held(uobj->vmobjlock)) ||
(flags & PGO_LOCKED) == 0);
KASSERT(rw_lock_held(uobj->vmobjlock));
KASSERT(rw_write_held(uobj->vmobjlock) ||
((flags & PGO_LOCKED) != 0 && (access_type & PROT_WRITE) == 0));
/* step 1: handled the case where fault data structures are locked. */
if (flags & PGO_LOCKED) {