Commit e3c48078 authored by Ralf Baechle's avatar Ralf Baechle

Define __raw_read_can_lock / __raw_write_can_lock.

Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent f638d197
...@@ -119,6 +119,18 @@ static inline unsigned int __raw_spin_trylock(raw_spinlock_t *lock) ...@@ -119,6 +119,18 @@ static inline unsigned int __raw_spin_trylock(raw_spinlock_t *lock)
* read-locks. * read-locks.
*/ */
/*
* read_can_lock - would read_trylock() succeed?
* @lock: the rwlock in question.
*/
#define __raw_read_can_lock(rw) ((rw)->lock >= 0)
/*
* write_can_lock - would write_trylock() succeed?
* @lock: the rwlock in question.
*/
#define __raw_write_can_lock(rw) (!(rw)->lock)
static inline void __raw_read_lock(raw_rwlock_t *rw) static inline void __raw_read_lock(raw_rwlock_t *rw)
{ {
unsigned int tmp; unsigned int tmp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment