Print this page
patch as-lock-macro-simplification
@@ -194,11 +194,11 @@
* stop() when SWATCHOK is set, so we need to handle multiple threads
* at once. See holdwatch() for the details of this dance.
*/
mutex_enter(&p->p_maplock);
- AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+ AS_LOCK_ENTER(as, RW_READER);
tpw.wp_vaddr = (caddr_t)((uintptr_t)addr & (uintptr_t)PAGEMASK);
if ((pwp = avl_find(&as->a_wpage, &tpw, &where)) == NULL)
pwp = avl_nearest(&as->a_wpage, where, AVL_AFTER);
@@ -233,22 +233,22 @@
if (p->p_mapcnt == 0) {
/*
* Release as lock while in holdwatch()
* in case other threads need to grab it.
*/
- AS_LOCK_EXIT(as, &as->a_lock);
+ AS_LOCK_EXIT(as);
mutex_exit(&p->p_maplock);
if (holdwatch() != 0) {
/*
* We stopped in holdwatch().
* Start all over again because the
* watched page list may have changed.
*/
goto startover;
}
mutex_enter(&p->p_maplock);
- AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+ AS_LOCK_ENTER(as, RW_READER);
}
p->p_mapcnt++;
}
addr = pwp->wp_vaddr;
@@ -304,12 +304,12 @@
if (pwp->wp_oprot != 0) { /* if page exists */
struct seg *seg;
uint_t oprot;
int err, retrycnt = 0;
- AS_LOCK_EXIT(as, &as->a_lock);
- AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+ AS_LOCK_EXIT(as);
+ AS_LOCK_ENTER(as, RW_WRITER);
retry:
seg = as_segat(as, addr);
ASSERT(seg != NULL);
SEGOP_GETPROT(seg, addr, 0, &oprot);
if (prot != oprot) {
@@ -318,13 +318,13 @@
ASSERT(retrycnt == 0);
retrycnt++;
goto retry;
}
}
- AS_LOCK_EXIT(as, &as->a_lock);
+ AS_LOCK_EXIT(as);
} else
- AS_LOCK_EXIT(as, &as->a_lock);
+ AS_LOCK_EXIT(as);
/*
* When all pages are mapped back to their normal state,
* continue the other lwps.
*/
@@ -338,14 +338,14 @@
mutex_exit(&p->p_lock);
mutex_enter(&p->p_maplock);
}
}
- AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+ AS_LOCK_ENTER(as, RW_READER);
}
- AS_LOCK_EXIT(as, &as->a_lock);
+ AS_LOCK_EXIT(as);
mutex_exit(&p->p_maplock);
return (rv);
}
@@ -392,11 +392,11 @@
if (p->p_wprot == NULL)
return;
ASSERT(MUTEX_NOT_HELD(&curproc->p_lock));
- AS_LOCK_ENTER(as, &as->a_lock, RW_WRITER);
+ AS_LOCK_ENTER(as, RW_WRITER);
pwp = p->p_wprot;
while (pwp != NULL) {
vaddr = pwp->wp_vaddr;
@@ -429,11 +429,11 @@
pwp = next;
}
p->p_wprot = NULL;
- AS_LOCK_EXIT(as, &as->a_lock);
+ AS_LOCK_EXIT(as);
}
/* Must be called with as lock held */
@@ -503,13 +503,13 @@
if ((as == &kas) || avl_numnodes(&as->a_wpage) == 0)
return (0);
/* Grab the lock because of XHAT (see comment in pr_mappage()) */
- AS_LOCK_ENTER(as, &as->a_lock, RW_READER);
+ AS_LOCK_ENTER(as, RW_READER);
rv = pr_is_watchpage_as(addr, rw, as);
- AS_LOCK_EXIT(as, &as->a_lock);
+ AS_LOCK_EXIT(as);
return (rv);
}