summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2005-03-31 05:18:19 +0000
committerjeff <jeff@FreeBSD.org>2005-03-31 05:18:19 +0000
commit27112458d3c50f602c330698adc64c6fdd225307 (patch)
tree647f7a8669acc1456ad7921fbf3a6246ab539613 /sys/kern
parent0f37f556b7b917470b04f16a84165624c63eca58 (diff)
downloadFreeBSD-src-27112458d3c50f602c330698adc64c6fdd225307.zip
FreeBSD-src-27112458d3c50f602c330698adc64c6fdd225307.tar.gz
- Add a LK_NOSHARE flag which forces all shared lock requests to be
treated as exclusive lock requests. Sponsored by: Isilon Systems, Inc.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_lock.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c
index cc415af..6762c1b 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) {
OpenPOWER on IntegriCloud