aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJeff Roberson <jeff@FreeBSD.org>2005-03-31 05:18:19 +0000
committerJeff Roberson <jeff@FreeBSD.org>2005-03-31 05:18:19 +0000
commitc4c0ec5ba757f3073dc5ef56f0cac931f8610160 (patch)
tree647f7a8669acc1456ad7921fbf3a6246ab539613 /sys
parent6e3a31bd67bcc9d7fb16ddbd0df4d6eecef9dd4b (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_lock.c6
-rw-r--r--sys/sys/lockmgr.h1
2 files changed, 6 insertions, 1 deletions
diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c
index cc415af83abd..6762c1b119ca 100644
--- a/sys/kern/kern_lock.c
+++ b/sys/kern/kern_lock.c
@@ -218,7 +218,11 @@ debuglockmgr(lkp, flags, interlkp, td, name, file, line)
mtx_unlock(lkp->lk_interlock);
return (0);
}
-
+ if ((lkp->lk_flags & LK_NOSHARE) &&
+ (flags & LK_TYPE_MASK) == LK_SHARED) {
+ flags &= ~LK_TYPE_MASK;
+ flags |= LK_EXCLUSIVE;
+ }
extflags = (flags | lkp->lk_flags) & LK_EXTFLG_MASK;
switch (flags & LK_TYPE_MASK) {
diff --git a/sys/sys/lockmgr.h b/sys/sys/lockmgr.h
index b90082455daa..248ac71f8b97 100644
--- a/sys/sys/lockmgr.h
+++ b/sys/sys/lockmgr.h
@@ -120,6 +120,7 @@ struct lock {
#define LK_NOWAIT 0x00000010 /* do not sleep to await lock */
#define LK_SLEEPFAIL 0x00000020 /* sleep, then return failure */
#define LK_CANRECURSE 0x00000040 /* allow recursive exclusive lock */
+#define LK_NOSHARE 0x00000080 /* Only allow exclusive locks */
#define LK_TIMELOCK 0x00000100 /* use lk_timo, else no timeout */
/*
* Nonpersistent external flags.