--- old/usr/src/uts/common/vm/seg_vn.c	2015-11-25 13:59:40.418199109 -0500
+++ new/usr/src/uts/common/vm/seg_vn.c	2015-11-25 13:59:40.422569973 -0500
@@ -551,7 +551,7 @@
 	int use_rgn = 0;
 	int trok = 0;
 
-	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as));
 
 	if (a->type != MAP_PRIVATE && a->type != MAP_SHARED) {
 		panic("segvn_create type");
@@ -1022,7 +1022,7 @@
 	pgcnt_t npages1, npages2;
 
 	ASSERT(seg1->s_as && seg2->s_as && seg1->s_as == seg2->s_as);
-	ASSERT(AS_WRITE_HELD(seg1->s_as, &seg1->s_as->a_lock));
+	ASSERT(AS_WRITE_HELD(seg1->s_as));
 	ASSERT(seg1->s_ops == seg2->s_ops);
 
 	if (HAT_IS_REGION_COOKIE_VALID(svd1->rcookie) ||
@@ -1267,7 +1267,7 @@
 	 * We don't need any segment level locks for "segvn" data
 	 * since the address space is "write" locked.
 	 */
-	ASSERT(seg1->s_as && AS_WRITE_HELD(seg1->s_as, &seg1->s_as->a_lock));
+	ASSERT(seg1->s_as && AS_WRITE_HELD(seg1->s_as));
 
 	if (HAT_IS_REGION_COOKIE_VALID(svd1->rcookie)) {
 		return (-1);
@@ -1388,7 +1388,7 @@
 	 * We don't need any segment level locks for "segvn" data
 	 * since the address space is "write" locked.
 	 */
-	ASSERT(seg2->s_as && AS_WRITE_HELD(seg2->s_as, &seg2->s_as->a_lock));
+	ASSERT(seg2->s_as && AS_WRITE_HELD(seg2->s_as));
 
 	if (HAT_IS_REGION_COOKIE_VALID(svd2->rcookie)) {
 		return (-1);
@@ -1575,7 +1575,7 @@
 	size_t len;
 	struct anon_map *amp;
 
-	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as));
 	ASSERT(newseg->s_as->a_proc->p_parent == curproc);
 
 	/*
@@ -1872,7 +1872,7 @@
 	 * We don't need any segment level locks for "segvn" data
 	 * since the address space is "write" locked.
 	 */
-	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as));
 
 	/*
 	 * Fail the unmap if pages are SOFTLOCKed through this mapping.
@@ -2422,7 +2422,7 @@
 	 * We don't need any segment level locks for "segvn" data
 	 * since the address space is "write" locked.
 	 */
-	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as));
 	ASSERT(svd->tr_state == SEGVN_TR_OFF);
 
 	ASSERT(svd->rcookie == HAT_INVALID_REGION_COOKIE);
@@ -2572,7 +2572,7 @@
 	struct anon_map *amp;
 	struct anon *ap = NULL;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 	ASSERT(SEGVN_LOCK_HELD(seg->s_as, &svd->lock));
 
 	if ((amp = svd->amp) != NULL)
@@ -4961,7 +4961,7 @@
 	anon_sync_obj_t cookie;
 	int brkcow = BREAK_COW_SHARE(rw, type, svd->type);
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 	ASSERT(svd->amp == NULL || svd->rcookie == HAT_INVALID_REGION_COOKIE);
 
 	/*
@@ -4970,7 +4970,7 @@
 	if (type == F_SOFTUNLOCK) {
 		if (rw == S_READ_NOCOW) {
 			rw = S_READ;
-			ASSERT(AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+			ASSERT(AS_WRITE_HELD(seg->s_as));
 		}
 		SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_READER);
 		pgsz = (seg->s_szc == 0) ? PAGESIZE :
@@ -5115,7 +5115,7 @@
 			}
 		}
 
-		ASSERT(demote || AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+		ASSERT(demote || AS_WRITE_HELD(seg->s_as));
 
 		if (demote) {
 			SEGVN_LOCK_EXIT(seg->s_as, &svd->lock);
@@ -5169,7 +5169,7 @@
 	 */
 	if (rw == S_READ_NOCOW) {
 		ASSERT(type == F_SOFTLOCK);
-		ASSERT(AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+		ASSERT(AS_WRITE_HELD(seg->s_as));
 		rw = S_READ;
 	}
 
@@ -5640,7 +5640,7 @@
 	struct anon_map *amp;
 	vnode_t *vp;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_READER);
 	if ((amp = svd->amp) != NULL) {
@@ -5697,7 +5697,7 @@
 	anon_sync_obj_t cookie;
 	int unload_done = 0;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	if ((svd->maxprot & prot) != prot)
 		return (EACCES);			/* violated maxprot */
@@ -5774,7 +5774,7 @@
 			 * we need to return IE_RETRY and let the as
 			 * layer drop and re-acquire the lock as a writer.
 			 */
-			if (AS_READ_HELD(seg->s_as, &seg->s_as->a_lock))
+			if (AS_READ_HELD(seg->s_as))
 				return (IE_RETRY);
 			VM_STAT_ADD(segvnvmstats.demoterange[1]);
 			if (svd->type == MAP_PRIVATE || svd->vp != NULL) {
@@ -6100,7 +6100,7 @@
 	int err;
 	u_offset_t off = svd->offset + (uintptr_t)(addr - seg->s_base);
 
-	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_WRITE_HELD(seg->s_as));
 	ASSERT(addr >= seg->s_base && eaddr <= seg->s_base + seg->s_size);
 
 	if (seg->s_szc == szc || segvn_lpg_disable != 0) {
@@ -6388,7 +6388,7 @@
 	uint_t prot = svd->prot, vpprot;
 	int pageflag = 0;
 
-	ASSERT(AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock) ||
+	ASSERT(AS_WRITE_HELD(seg->s_as) ||
 	    SEGVN_WRITE_HELD(seg->s_as, &svd->lock));
 	ASSERT(svd->softlockcnt == 0);
 
@@ -6600,7 +6600,7 @@
 	size_t nsize;
 	struct segvn_data *nsvd;
 
-	ASSERT(AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(AS_WRITE_HELD(seg->s_as));
 	ASSERT(svd->tr_state == SEGVN_TR_OFF);
 
 	ASSERT(addr >= seg->s_base);
@@ -6755,7 +6755,7 @@
 	uint_t szc = seg->s_szc;
 	uint_t tszcvec;
 
-	ASSERT(AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(AS_WRITE_HELD(seg->s_as));
 	ASSERT(svd->tr_state == SEGVN_TR_OFF);
 	ASSERT(szc != 0);
 	pgsz = page_get_pagesize(szc);
@@ -6884,7 +6884,7 @@
 	struct segvn_data *svd = (struct segvn_data *)seg->s_data;
 	struct vpage *vp, *evp;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_READER);
 	/*
@@ -6918,7 +6918,7 @@
 	struct segvn_data *svd = (struct segvn_data *)seg->s_data;
 	size_t pgno = seg_page(seg, addr + len) - seg_page(seg, addr) + 1;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	if (pgno != 0) {
 		SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_READER);
@@ -6944,7 +6944,7 @@
 {
 	struct segvn_data *svd = (struct segvn_data *)seg->s_data;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	return (svd->offset + (uintptr_t)(addr - seg->s_base));
 }
@@ -6955,7 +6955,7 @@
 {
 	struct segvn_data *svd = (struct segvn_data *)seg->s_data;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	return (svd->type | (svd->flags & (MAP_NORESERVE | MAP_TEXT |
 	    MAP_INITDATA)));
@@ -6967,7 +6967,7 @@
 {
 	struct segvn_data *svd = (struct segvn_data *)seg->s_data;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	*vpp = svd->vp;
 	return (0);
@@ -6994,8 +6994,8 @@
 	u_offset_t off1, off2;
 	struct anon_map *amp;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
-	ASSERT(AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock) ||
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
+	ASSERT(AS_WRITE_HELD(seg->s_as) ||
 	    SEGVN_LOCK_HELD(seg->s_as, &svd->lock));
 
 	if (addr + delta < seg->s_base ||
@@ -7100,7 +7100,7 @@
 	pgcnt_t page;
 	ulong_t anon_index;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_READER);
 	/*
@@ -7279,7 +7279,7 @@
 	struct anon *ap;
 	anon_sync_obj_t cookie;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_READER);
 
@@ -7501,7 +7501,7 @@
 	uint_t attr;
 	anon_sync_obj_t cookie;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_READER);
 	if (svd->amp == NULL && svd->vp == NULL) {
@@ -7677,7 +7677,7 @@
 	 * Hold write lock on address space because may split or concatenate
 	 * segments
 	 */
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	/*
 	 * If this is a shm, use shm's project and zone, else use
@@ -8093,7 +8093,7 @@
 	struct seg *prev;
 	struct vnode *vp;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	/*
 	 * In case of MADV_FREE, we won't be modifying any segment private
@@ -8221,8 +8221,7 @@
 				 * address space because the segment may be
 				 * split or concatenated when changing policy
 				 */
-				if (AS_READ_HELD(seg->s_as,
-				    &seg->s_as->a_lock)) {
+				if (AS_READ_HELD(seg->s_as)) {
 					SEGVN_LOCK_EXIT(seg->s_as, &svd->lock);
 					return (IE_RETRY);
 				}
@@ -8372,7 +8371,7 @@
 			 * split or concatenated when changing policy
 			 */
 			if (svd->type == MAP_PRIVATE &&
-			    AS_READ_HELD(seg->s_as, &seg->s_as->a_lock)) {
+			    AS_READ_HELD(seg->s_as)) {
 				SEGVN_LOCK_EXIT(seg->s_as, &svd->lock);
 				return (IE_RETRY);
 			}
@@ -8558,7 +8557,7 @@
 	size_t page;
 	int ret = 0;
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 
 	/* Can't support something we don't know about */
 	if (behav != SEGP_INH_ZERO)
@@ -8827,7 +8826,7 @@
 	TRACE_2(TR_FAC_PHYSIO, TR_PHYSIO_SEGVN_START,
 	    "segvn_pagelock: start seg %p addr %p", seg, addr);
 
-	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(seg->s_as && AS_LOCK_HELD(seg->s_as));
 	ASSERT(type == L_PAGELOCK || type == L_PAGEUNLOCK);
 
 	SEGVN_LOCK_ENTER(seg->s_as, &svd->lock, RW_READER);
@@ -9449,7 +9448,7 @@
 
 	ASSERT(svd->vp == NULL && svd->amp != NULL);
 	ASSERT(svd->softlockcnt >= npages);
-	ASSERT(async || AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(async || AS_LOCK_HELD(seg->s_as));
 
 	pl = pplist;
 
@@ -9727,7 +9726,7 @@
 	int			first;
 	struct anon_map		*amp;
 
-	ASSERT(AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
+	ASSERT(AS_LOCK_HELD(seg->s_as));
 	ASSERT(SEGVN_WRITE_HELD(seg->s_as, &svd->lock));
 	ASSERT(p != NULL);
 	ASSERT(svd->tr_state == SEGVN_TR_INIT);
@@ -10008,8 +10007,8 @@
 	lgrp_id_t		lgrp_id = svd->tr_policy_info.mem_lgrpid;
 	lgrp_id_t		i;
 
-	ASSERT(AS_LOCK_HELD(seg->s_as, &seg->s_as->a_lock));
-	ASSERT(AS_WRITE_HELD(seg->s_as, &seg->s_as->a_lock) ||
+	ASSERT(AS_LOCK_HELD(seg->s_as));
+	ASSERT(AS_WRITE_HELD(seg->s_as) ||
 	    SEGVN_WRITE_HELD(seg->s_as, &svd->lock));
 	ASSERT(svd->tr_state == SEGVN_TR_ON);
 	ASSERT(!HAT_IS_REGION_COOKIE_VALID(svd->rcookie));
@@ -10234,7 +10233,7 @@
 	 * Use tryenter locking since we are locking as/seg and svntr hash
 	 * lock in reverse from syncrounous thread order.
 	 */
-	if (!AS_LOCK_TRYENTER(as, &as->a_lock, RW_READER)) {
+	if (!AS_LOCK_TRYENTER(as, RW_READER)) {
 		SEGVN_TR_ADDSTAT(nolock);
 		if (segvn_lgrp_trthr_migrs_snpsht) {
 			segvn_lgrp_trthr_migrs_snpsht = 0;
@@ -10242,7 +10241,7 @@
 		return;
 	}
 	if (!SEGVN_LOCK_TRYENTER(seg->s_as, &svd->lock, RW_WRITER)) {
-		AS_LOCK_EXIT(as, &as->a_lock);
+		AS_LOCK_EXIT(as);
 		SEGVN_TR_ADDSTAT(nolock);
 		if (segvn_lgrp_trthr_migrs_snpsht) {
 			segvn_lgrp_trthr_migrs_snpsht = 0;
@@ -10254,14 +10253,14 @@
 		size_t trmem = atomic_add_long_nv(&segvn_textrepl_bytes, size);
 		if (trmem > segvn_textrepl_max_bytes) {
 			SEGVN_LOCK_EXIT(seg->s_as, &svd->lock);
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			atomic_add_long(&segvn_textrepl_bytes, -size);
 			SEGVN_TR_ADDSTAT(normem);
 			return;
 		}
 		if (anon_try_resv_zone(size, NULL) == 0) {
 			SEGVN_LOCK_EXIT(seg->s_as, &svd->lock);
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			atomic_add_long(&segvn_textrepl_bytes, -size);
 			SEGVN_TR_ADDSTAT(noanon);
 			return;
@@ -10269,7 +10268,7 @@
 		amp = anonmap_alloc(size, size, KM_NOSLEEP);
 		if (amp == NULL) {
 			SEGVN_LOCK_EXIT(seg->s_as, &svd->lock);
-			AS_LOCK_EXIT(as, &as->a_lock);
+			AS_LOCK_EXIT(as);
 			atomic_add_long(&segvn_textrepl_bytes, -size);
 			anon_unresv_zone(size, NULL);
 			SEGVN_TR_ADDSTAT(nokmem);
@@ -10301,7 +10300,7 @@
 	svd->amp = svntrp->tr_amp[lgrp_id];
 	p->p_tr_lgrpid = NLGRPS_MAX;
 	SEGVN_LOCK_EXIT(seg->s_as, &svd->lock);
-	AS_LOCK_EXIT(as, &as->a_lock);
+	AS_LOCK_EXIT(as);
 
 	ASSERT(svntrp->tr_refcnt != 0);
 	ASSERT(svd->vp == svntrp->tr_vp);
