diff options
author | jhb <jhb@FreeBSD.org> | 2007-05-19 21:26:05 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2007-05-19 21:26:05 +0000 |
commit | 124d541ab4acefde141dea3737f7f29698982ed4 (patch) | |
tree | 9d3d7d22180ea60f42dff58637c17d8bf8ceb8ef /sys/kern/kern_sx.c | |
parent | 07a8df93210bc72e90e316d09db447acfdf4c10f (diff) | |
download | FreeBSD-src-124d541ab4acefde141dea3737f7f29698982ed4.zip FreeBSD-src-124d541ab4acefde141dea3737f7f29698982ed4.tar.gz |
Rename the macros for assertion flags passed to sx_assert() from SX_* to
SA_* to match mutexes and rwlocks. The old flags still exist for
backwards compatiblity.
Requested by: attilio
Diffstat (limited to 'sys/kern/kern_sx.c')
-rw-r--r-- | sys/kern/kern_sx.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/sys/kern/kern_sx.c b/sys/kern/kern_sx.c index f60e1e1..ea7d036 100644 --- a/sys/kern/kern_sx.c +++ b/sys/kern/kern_sx.c @@ -139,7 +139,7 @@ unlock_sx(struct lock_object *lock) struct sx *sx; sx = (struct sx *)lock; - sx_assert(sx, SX_LOCKED | SX_NOTRECURSED); + sx_assert(sx, SA_LOCKED | SA_NOTRECURSED); if (sx_xlocked(sx)) { sx_xunlock(sx); return (1); @@ -273,7 +273,7 @@ _sx_sunlock(struct sx *sx, const char *file, int line) MPASS(curthread != NULL); KASSERT(sx->sx_lock != SX_LOCK_DESTROYED, ("sx_sunlock() of destroyed sx @ %s:%d", file, line)); - _sx_assert(sx, SX_SLOCKED, file, line); + _sx_assert(sx, SA_SLOCKED, file, line); curthread->td_locks--; WITNESS_UNLOCK(&sx->lock_object, 0, file, line); LOCK_LOG_LOCK("SUNLOCK", &sx->lock_object, 0, 0, file, line); @@ -289,7 +289,7 @@ _sx_xunlock(struct sx *sx, const char *file, int line) MPASS(curthread != NULL); KASSERT(sx->sx_lock != SX_LOCK_DESTROYED, ("sx_xunlock() of destroyed sx @ %s:%d", file, line)); - _sx_assert(sx, SX_XLOCKED, file, line); + _sx_assert(sx, SA_XLOCKED, file, line); curthread->td_locks--; WITNESS_UNLOCK(&sx->lock_object, LOP_EXCLUSIVE, file, line); LOCK_LOG_LOCK("XUNLOCK", &sx->lock_object, 0, sx->sx_recurse, file, @@ -312,7 +312,7 @@ _sx_try_upgrade(struct sx *sx, const char *file, int line) KASSERT(sx->sx_lock != SX_LOCK_DESTROYED, ("sx_try_upgrade() of destroyed sx @ %s:%d", file, line)); - _sx_assert(sx, SX_SLOCKED, file, line); + _sx_assert(sx, SA_SLOCKED, file, line); /* * Try to switch from one shared lock to an exclusive lock. We need @@ -339,7 +339,7 @@ _sx_downgrade(struct sx *sx, const char *file, int line) KASSERT(sx->sx_lock != SX_LOCK_DESTROYED, ("sx_downgrade() of destroyed sx @ %s:%d", file, line)); - _sx_assert(sx, SX_XLOCKED | SX_NOTRECURSED, file, line); + _sx_assert(sx, SA_XLOCKED | SA_NOTRECURSED, file, line); #ifndef INVARIANTS if (sx_recursed(sx)) panic("downgrade of a recursed lock"); @@ -845,16 +845,16 @@ _sx_assert(struct sx *sx, int what, const char *file, int line) if (panicstr != NULL) return; switch (what) { - case SX_SLOCKED: - case SX_SLOCKED | SX_NOTRECURSED: - case SX_SLOCKED | SX_RECURSED: + case SA_SLOCKED: + case SA_SLOCKED | SA_NOTRECURSED: + case SA_SLOCKED | SA_RECURSED: #ifndef WITNESS slocked = 1; /* FALLTHROUGH */ #endif - case SX_LOCKED: - case SX_LOCKED | SX_NOTRECURSED: - case SX_LOCKED | SX_RECURSED: + case SA_LOCKED: + case SA_LOCKED | SA_NOTRECURSED: + case SA_LOCKED | SA_RECURSED: #ifdef WITNESS witness_assert(&sx->lock_object, what, file, line); #else @@ -872,31 +872,31 @@ _sx_assert(struct sx *sx, int what, const char *file, int line) if (!(sx->sx_lock & SX_LOCK_SHARED)) { if (sx_recursed(sx)) { - if (what & SX_NOTRECURSED) + if (what & SA_NOTRECURSED) panic("Lock %s recursed @ %s:%d\n", sx->lock_object.lo_name, file, line); - } else if (what & SX_RECURSED) + } else if (what & SA_RECURSED) panic("Lock %s not recursed @ %s:%d\n", sx->lock_object.lo_name, file, line); } #endif break; - case SX_XLOCKED: - case SX_XLOCKED | SX_NOTRECURSED: - case SX_XLOCKED | SX_RECURSED: + case SA_XLOCKED: + case SA_XLOCKED | SA_NOTRECURSED: + case SA_XLOCKED | SA_RECURSED: if (sx_xholder(sx) != curthread) panic("Lock %s not exclusively locked @ %s:%d\n", sx->lock_object.lo_name, file, line); if (sx_recursed(sx)) { - if (what & SX_NOTRECURSED) + if (what & SA_NOTRECURSED) panic("Lock %s recursed @ %s:%d\n", sx->lock_object.lo_name, file, line); - } else if (what & SX_RECURSED) + } else if (what & SA_RECURSED) panic("Lock %s not recursed @ %s:%d\n", sx->lock_object.lo_name, file, line); break; - case SX_UNLOCKED: + case SA_UNLOCKED: #ifdef WITNESS witness_assert(&sx->lock_object, what, file, line); #else |