[PATCH] m32r: revise __raw_read_trylock()
Signed-off-by: Hirokazu Takata <takata@linux-m32r.org> Cc: Matthew Wilcox <matthew@wil.cx> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
a27f311332
commit
85f651794c
|
@ -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 New Issue