diff options
author | attilio <attilio@FreeBSD.org> | 2008-04-12 19:57:30 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2008-04-12 19:57:30 +0000 |
commit | 7ba94cc4496c5cac5ae24fbe82fe73ef1b300506 (patch) | |
tree | 3f1f4c2de65ff6045c3a73473726e638c8ce2711 /sys/kern/subr_witness.c | |
parent | c7e894e8b0e9bdaf380328d6ca4d813f4443304c (diff) | |
download | FreeBSD-src-7ba94cc4496c5cac5ae24fbe82fe73ef1b300506.zip FreeBSD-src-7ba94cc4496c5cac5ae24fbe82fe73ef1b300506.tar.gz |
- Re-introduce WITNESS support for lockmgr. About the old implementation
the only one difference is that lockmgr*() functions now accept
LK_NOWITNESS flag which skips ordering for the instanced calling.
- Remove an unuseful stub in witness_checkorder() (because the above check
doesn't allow ever happening) and allow witness_upgrade() to accept
non-try operation too.
Diffstat (limited to 'sys/kern/subr_witness.c')
-rw-r--r-- | sys/kern/subr_witness.c | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c index c310319..6fa43d6 100644 --- a/sys/kern/subr_witness.c +++ b/sys/kern/subr_witness.c @@ -930,14 +930,6 @@ witness_checkorder(struct lock_object *lock, int flags, const char *file, } /* - * Try locks do not block if they fail to acquire the lock, thus - * there is no danger of deadlocks or of switching while holding a - * spin lock if we acquire a lock via a try operation. - */ - if (flags & LOP_TRYLOCK) - return; - - /* * Check for duplicate locks of the same type. Note that we only * have to check for this on the last lock we just acquired. Any * other cases will be caught as lock order violations. @@ -1205,9 +1197,6 @@ witness_upgrade(struct lock_object *lock, int flags, const char *file, int line) if ((lock->lo_flags & LO_UPGRADABLE) == 0) panic("upgrade of non-upgradable lock (%s) %s @ %s:%d", class->lc_name, lock->lo_name, file, line); - if ((flags & LOP_TRYLOCK) == 0) - panic("non-try upgrade of lock (%s) %s @ %s:%d", class->lc_name, - lock->lo_name, file, line); if ((class->lc_flags & LC_SLEEPLOCK) == 0) panic("upgrade of non-sleep lock (%s) %s @ %s:%d", class->lc_name, lock->lo_name, file, line); |