Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F108621902
D45248.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D45248.diff
View Options
diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c
--- a/sys/kern/kern_lock.c
+++ b/sys/kern/kern_lock.c
@@ -138,9 +138,6 @@
#define LK_TRYWIT(x) \
(LK_TRYOP(x) ? LOP_TRYLOCK : 0)
-#define lockmgr_disowned(lk) \
- (((lk)->lk_lock & ~(LK_FLAGMASK & ~LK_SHARE)) == LK_KERNPROC)
-
#define lockmgr_xlocked_v(v) \
(((v) & ~(LK_FLAGMASK & ~LK_SHARE)) == (uintptr_t)curthread)
@@ -243,7 +240,7 @@
lockmgr_note_exclusive_release(struct lock *lk, const char *file, int line)
{
- if (LK_HOLDER(lockmgr_read_value(lk)) != LK_KERNPROC) {
+ if (!lockmgr_disowned(lk)) {
WITNESS_UNLOCK(&lk->lock_object, LOP_EXCLUSIVE, file, line);
TD_LOCKS_DEC(curthread);
}
@@ -1135,7 +1132,7 @@
* any waiter.
* Fix-up the tid var if the lock has been disowned.
*/
- if (LK_HOLDER(x) == LK_KERNPROC)
+ if (lockmgr_disowned_v(x))
tid = LK_KERNPROC;
/*
diff --git a/sys/sys/lockmgr.h b/sys/sys/lockmgr.h
--- a/sys/sys/lockmgr.h
+++ b/sys/sys/lockmgr.h
@@ -130,6 +130,10 @@
LOCK_FILE, LOCK_LINE)
#define lockmgr_disown(lk) \
_lockmgr_disown((lk), LOCK_FILE, LOCK_LINE)
+#define lockmgr_disowned_v(v) \
+ (LK_HOLDER((v)) == LK_KERNPROC)
+#define lockmgr_disowned(lk) \
+ lockmgr_disowned_v(lockmgr_read_value((lk)))
#define lockmgr_recursed_v(v) \
(v & LK_WRITER_RECURSED)
#define lockmgr_recursed(lk) \
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jan 27, 10:57 PM (9 h, 52 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16218782
Default Alt Text
D45248.diff (1 KB)
Attached To
Mode
D45248: lockmgr: make lockmgr_disowned public and use it
Attached
Detach File
Event Timeline
Log In to Comment