diff options
author | attilio <attilio@FreeBSD.org> | 2008-04-12 13:56:17 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2008-04-12 13:56:17 +0000 |
commit | 6c6f1ddb9ca2ebad1c9be19cf76d03f2e632cbd2 (patch) | |
tree | c6528cf70dc9ed0ddcf83c63e4ea9967b90301bf /sys/kern/kern_lock.c | |
parent | 4364cd23ef9506a34c5fc4d0ab1a241d5bc05362 (diff) | |
download | FreeBSD-src-6c6f1ddb9ca2ebad1c9be19cf76d03f2e632cbd2.zip FreeBSD-src-6c6f1ddb9ca2ebad1c9be19cf76d03f2e632cbd2.tar.gz |
- Remove a stale comment.
- Add an extra assertion in order to catch malformed requested operations.
Diffstat (limited to 'sys/kern/kern_lock.c')
-rw-r--r-- | sys/kern/kern_lock.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c index 7722c15..099a5be 100644 --- a/sys/kern/kern_lock.c +++ b/sys/kern/kern_lock.c @@ -319,6 +319,8 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lock_object *ilk, itimo = (timo == LK_TIMO_DEFAULT) ? lk->lk_timo : timo; MPASS((flags & ~LK_TOTAL_MASK) == 0); + KASSERT((op & (op - 1)) == 0, + ("%s: Invalid requested operation @ %s:%d", __func__, file, line)); KASSERT((flags & (LK_NOWAIT | LK_SLEEPFAIL)) == 0 || (op != LK_DOWNGRADE && op != LK_RELEASE), ("%s: Invalid flags in regard of the operation desired @ %s:%d", @@ -797,10 +799,6 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lock_object *ilk, panic("%s: unknown lockmgr request 0x%x\n", __func__, op); } - /* - * We could have exited from the switch without reacquiring the - * interlock, so we need to check for the interlock ownership. - */ if (flags & LK_INTERLOCK) class->lc_unlock(ilk); |