Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bc8846c5 authored by Kyle McMartin's avatar Kyle McMartin Committed by Kyle McMartin
Browse files

[PARISC] More useful readwrite lock helpers



spinlock.c needs _can_lock helpers. Rewrite _is_locked helpers to be
_can_lock helpers.

Signed-off-by: default avatarKyle McMartin <kyle@parisc-linux.org>
parent 102c8c76
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -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 */