diff options
author | attilio <attilio@FreeBSD.org> | 2008-02-06 00:04:09 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2008-02-06 00:04:09 +0000 |
commit | acc2f89a7fb9267906b61ccf186132ea33aa2eda (patch) | |
tree | 1b1f73dd58702a12d8c524882db74b0a9ff444d9 /sys/kern/kern_timeout.c | |
parent | 12170a7b3f1afc618eee92f338c6799312fc0f7e (diff) | |
download | FreeBSD-src-acc2f89a7fb9267906b61ccf186132ea33aa2eda.zip FreeBSD-src-acc2f89a7fb9267906b61ccf186132ea33aa2eda.tar.gz |
Really, no explicit checks against against lock_class_* object should be
done in consumers code: using locks properties is much more appropriate.
Fix current code doing these bogus checks.
Note: Really, callout are not usable by all !(LC_SPINLOCK | LC_SLEEPABLE)
primitives like rmlocks doesn't implement the generic lock layer
functions, but they can be equipped for this, so the check is still
valid.
Tested by: matteo, kris (earlier version)
Reviewed by: jhb
Diffstat (limited to 'sys/kern/kern_timeout.c')
-rw-r--r-- | sys/kern/kern_timeout.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c index 143e38c..d48bf2e 100644 --- a/sys/kern/kern_timeout.c +++ b/sys/kern/kern_timeout.c @@ -639,8 +639,8 @@ _callout_init_lock(c, lock, flags) ("callout_init_lock: bad flags %d", flags)); KASSERT(lock != NULL || (flags & CALLOUT_RETURNUNLOCKED) == 0, ("callout_init_lock: CALLOUT_RETURNUNLOCKED with no lock")); - KASSERT(lock == NULL || LOCK_CLASS(lock) == &lock_class_mtx_sleep || - LOCK_CLASS(lock) == &lock_class_rw, ("%s: invalid lock class", + KASSERT(lock == NULL || !(LOCK_CLASS(lock)->lc_flags & + (LC_SPINLOCK | LC_SLEEPABLE)), ("%s: invalid lock class", __func__)); c->c_flags = flags & (CALLOUT_RETURNUNLOCKED | CALLOUT_SHAREDLOCK); } |