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

Commit e3c48078 authored by Ralf Baechle's avatar Ralf Baechle
Browse files

Define __raw_read_can_lock / __raw_write_can_lock.

parent f638d197
Loading
Loading
Loading
Loading
+12 −0
Original line number Original line Diff line number Diff line
@@ -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;