diff options
author | Kyle McMartin <kyle@parisc-linux.org> | 2006-03-24 21:22:02 -0700 |
---|---|---|
committer | Kyle McMartin <kyle@hera.kernel.org> | 2006-03-30 17:48:53 +0000 |
commit | bc8846c522264d2522b0082321ec8c2051a4536f (patch) | |
tree | a35d34fef7473635b58f4de04d50c5c897e74ce3 /include | |
parent | 102c8c76f787add0790406d5c47e03cb6f8765c2 (diff) | |
download | op-kernel-dev-bc8846c522264d2522b0082321ec8c2051a4536f.zip op-kernel-dev-bc8846c522264d2522b0082321ec8c2051a4536f.tar.gz |
[PARISC] More useful readwrite lock helpers
spinlock.c needs _can_lock helpers. Rewrite _is_locked helpers to be
_can_lock helpers.
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-parisc/spinlock.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/include/asm-parisc/spinlock.h b/include/asm-parisc/spinlock.h index 16c2ac0..a93960e 100644 --- a/include/asm-parisc/spinlock.h +++ b/include/asm-parisc/spinlock.h @@ -134,14 +134,22 @@ static __inline__ int __raw_write_trylock(raw_rwlock_t *rw) return 1; } -static __inline__ int __raw_is_read_locked(raw_rwlock_t *rw) +/* + * read_can_lock - would read_trylock() succeed? + * @lock: the rwlock in question. + */ +static __inline__ int __raw_read_can_lock(raw_rwlock_t *rw) { - return rw->counter > 0; + return rw->counter >= 0; } -static __inline__ int __raw_is_write_locked(raw_rwlock_t *rw) +/* + * write_can_lock - would write_trylock() succeed? + * @lock: the rwlock in question. + */ +static __inline__ int __raw_write_can_lock(raw_rwlock_t *rw) { - return rw->counter < 0; + return !rw->counter; } #endif /* __ASM_SPINLOCK_H */ |