Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F156697277
D27947.id81604.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
966 B
Referenced Files
None
Subscribers
None
D27947.id81604.diff
View Options
Index: sys/kern/kern_lock.c
===================================================================
--- sys/kern/kern_lock.c
+++ sys/kern/kern_lock.c
@@ -984,7 +984,7 @@
op = flags & LK_TYPE_MASK;
v = lockmgr_read_value(lk);
for (;;) {
- if (LK_SHARERS_LOCK(v) > 1) {
+ if (LK_SHARERS(v) > 1) {
if (op == LK_TRYUPGRADE) {
LOCK_LOG2(lk, "%s: %p failed the nowait upgrade",
__func__, lk);
Index: sys/sys/lockmgr.h
===================================================================
--- sys/sys/lockmgr.h
+++ sys/sys/lockmgr.h
@@ -50,7 +50,9 @@
#define LK_HOLDER(x) ((x) & ~LK_FLAGMASK)
#define LK_SHARERS_SHIFT 5
+/* How many sharers does this lock have */
#define LK_SHARERS(x) (LK_HOLDER(x) >> LK_SHARERS_SHIFT)
+/* What would be the value of a lock with this many sharers? */
#define LK_SHARERS_LOCK(x) ((x) << LK_SHARERS_SHIFT | LK_SHARE)
#define LK_ONE_SHARER (1 << LK_SHARERS_SHIFT)
#define LK_UNLOCKED LK_SHARERS_LOCK(0)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, May 16, 6:21 PM (4 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33144058
Default Alt Text
D27947.id81604.diff (966 B)
Attached To
Mode
D27947: Fix LK_TRYUPGRADE
Attached
Detach File
Event Timeline
Log In to Comment