mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-13 10:02:38 +00:00
rms: add rms_assert_rlock_ok
So that callers which opportunistically elide the lock can still assert that they can take it. Reviewed by: Differential Revision:
This commit is contained in:
parent
9e4e7bcaef
commit
9488262679
@ -1025,7 +1025,7 @@ rms_rlock(struct rmslock *rms)
|
||||
{
|
||||
struct rmslock_pcpu *pcpu;
|
||||
|
||||
WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, __func__);
|
||||
rms_assert_rlock_ok(rms);
|
||||
MPASS(atomic_load_ptr(&rms->owner) != curthread);
|
||||
|
||||
critical_enter();
|
||||
|
@ -150,6 +150,13 @@ rms_wowned(struct rmslock *rms)
|
||||
return (rms->owner == curthread);
|
||||
}
|
||||
|
||||
#ifdef INVARIANTS
|
||||
#define rms_assert_rlock_ok(x) \
|
||||
WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, __func__);
|
||||
#else
|
||||
#define rms_assert_rlock_ok(x)
|
||||
#endif
|
||||
|
||||
#ifdef INVARIANTS
|
||||
/*
|
||||
* For assertion purposes.
|
||||
|
Loading…
Reference in New Issue
Block a user