projects
/
linux-2.6-block.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge tag 'tty-5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
[linux-2.6-block.git]
/
kernel
/
locking
/
qrwlock.c
diff --git
a/kernel/locking/qrwlock.c
b/kernel/locking/qrwlock.c
index b94f3831e963a12576b33f5824251294147b938c..ec36b73f4733b1b065e63ba2440372bee4f4d799 100644
(file)
--- a/
kernel/locking/qrwlock.c
+++ b/
kernel/locking/qrwlock.c
@@
-66,12
+66,12
@@
void queued_write_lock_slowpath(struct qrwlock *lock)
arch_spin_lock(&lock->wait_lock);
/* Try to acquire the lock directly if no reader is present */
arch_spin_lock(&lock->wait_lock);
/* Try to acquire the lock directly if no reader is present */
- if (!
atomic_read(&lock->cnts
) &&
-
(atomic_cmpxchg_acquire(&lock->cnts, 0, _QW_LOCKED) == 0
))
+ if (!
(cnts = atomic_read(&lock->cnts)
) &&
+
atomic_try_cmpxchg_acquire(&lock->cnts, &cnts, _QW_LOCKED
))
goto unlock;
/* Set the waiting flag to notify readers that a writer is pending */
goto unlock;
/* Set the waiting flag to notify readers that a writer is pending */
- atomic_
add
(_QW_WAITING, &lock->cnts);
+ atomic_
or
(_QW_WAITING, &lock->cnts);
/* When no more readers or writers, set the locked flag */
do {
/* When no more readers or writers, set the locked flag */
do {