path: root/sys/sys/lock.h
diff options
authorRyan Libby <rlibby@FreeBSD.org>2019-11-27 01:54:39 +0000
committerRyan Libby <rlibby@FreeBSD.org>2019-11-27 01:54:39 +0000
commit59fb4a95c7f291f0cbbda1d56d3c7075410fca31 (patch)
tree23232013b78d1f6a3b5216a00087d111dd8a39e7 /sys/sys/lock.h
parent588e69e2fde146bab5ea3600f3d13a457ba318f2 (diff)
witness: sleepable rm locks are not sleepable in read mode
There are two classes of rm lock, one "sleepable" and one not. But even a "sleepable" rm lock is only sleepable in write mode, and is non-sleepable when taken in read mode. Warn about sleepable rm locks in read mode as non-sleepable locks. Do this by defining a new lock operation flag, LOP_NOSLEEP, to indicate that a lock is non-sleepable despite what the LO_SLEEPABLE flag would indicate, and defining a new witness lock instance flag, LI_SLEEPABLE, to track the product of LO_SLEEPABLE and LOP_NOSLEEP on the lock instance. Reviewed by: markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D22527
Notes: svn path=/head/; revision=355126
Diffstat (limited to 'sys/sys/lock.h')
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/sys/lock.h b/sys/sys/lock.h
index db2e697e563d..f8bf53014ff6 100644
--- a/sys/sys/lock.h
+++ b/sys/sys/lock.h
@@ -107,6 +107,7 @@ struct lock_class {
#define LOP_TRYLOCK 0x00000004 /* Don't check lock order. */
#define LOP_EXCLUSIVE 0x00000008 /* Exclusive lock. */
#define LOP_DUPOK 0x00000010 /* Don't check for duplicate acquires */
+#define LOP_NOSLEEP 0x00000020 /* Non-sleepable despite LO_SLEEPABLE */
/* Flags passed to witness_assert. */
#define LA_MASKASSERT 0x000000ff /* Mask for witness defined asserts. */