Lines Matching refs:count

83 	sem->count = RWSEM_UNLOCKED_VALUE;  in __init_rwsem()
216 long count, adjustment = -RWSEM_ACTIVE_READ_BIAS; in rwsem_down_read_failed() local
231 count = rwsem_atomic_update(adjustment, sem); in rwsem_down_read_failed()
238 if (count == RWSEM_WAITING_BIAS || in rwsem_down_read_failed()
239 (count > RWSEM_WAITING_BIAS && in rwsem_down_read_failed()
258 static inline bool rwsem_try_write_lock(long count, struct rw_semaphore *sem) in rwsem_try_write_lock() argument
264 if (count == RWSEM_WAITING_BIAS && in rwsem_try_write_lock()
265 cmpxchg(&sem->count, RWSEM_WAITING_BIAS, in rwsem_try_write_lock()
282 long old, count = READ_ONCE(sem->count); in rwsem_try_write_lock_unqueued() local
285 if (!(count == 0 || count == RWSEM_WAITING_BIAS)) in rwsem_try_write_lock_unqueued()
288 old = cmpxchg(&sem->count, count, count + RWSEM_ACTIVE_WRITE_BIAS); in rwsem_try_write_lock_unqueued()
289 if (old == count) { in rwsem_try_write_lock_unqueued()
294 count = old; in rwsem_try_write_lock_unqueued()
309 long count = READ_ONCE(sem->count); in rwsem_can_spin_on_owner() local
316 if (count & RWSEM_ACTIVE_MASK) in rwsem_can_spin_on_owner()
330 long count; in rwsem_spin_on_owner() local
360 count = READ_ONCE(sem->count); in rwsem_spin_on_owner()
361 return (count == 0 || count == RWSEM_WAITING_BIAS); in rwsem_spin_on_owner()
425 long count; in rwsem_down_write_failed() local
430 count = rwsem_atomic_update(-RWSEM_ACTIVE_WRITE_BIAS, sem); in rwsem_down_write_failed()
453 count = READ_ONCE(sem->count); in rwsem_down_write_failed()
460 if (count > RWSEM_WAITING_BIAS) in rwsem_down_write_failed()
464 count = rwsem_atomic_update(RWSEM_WAITING_BIAS, sem); in rwsem_down_write_failed()
469 if (rwsem_try_write_lock(count, sem)) in rwsem_down_write_failed()
477 } while ((count = sem->count) & RWSEM_ACTIVE_MASK); in rwsem_down_write_failed()