1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-18 15:30:21 +00:00

- Add a LK_NOSHARE flag which forces all shared lock requests to be

treated as exclusive lock requests.

Sponsored by:	Isilon Systems, Inc.
This commit is contained in:
Jeff Roberson 2005-03-31 05:18:19 +00:00
parent 6e3a31bd67
commit c4c0ec5ba7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=144372
2 changed files with 6 additions and 1 deletions

View File

@ -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) {

View File

@ -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.