mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
[PATCH] m32r: revise __raw_read_trylock()
Signed-off-by: Hirokazu Takata <[email protected]> Cc: Matthew Wilcox <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
a27f311332
commit
85f651794c
1 changed files with 8 additions and 1 deletions
|
|
@ -298,7 +298,14 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw)
|
|||
);
|
||||
}
|
||||
|
||||
#define __raw_read_trylock(lock) generic__raw_read_trylock(lock)
|
||||
static inline int __raw_read_trylock(raw_rwlock_t *lock)
|
||||
{
|
||||
atomic_t *count = (atomic_t*)lock;
|
||||
if (atomic_dec_return(count) >= 0)
|
||||
return 1;
|
||||
atomic_inc(count);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int __raw_write_trylock(raw_rwlock_t *lock)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue