Lines Matching refs:old
57 unsigned old, new; in refcount_inc_not_zero() local
60 old = atomic_read(&rc->rc_count); in refcount_inc_not_zero()
61 if (old == 0) in refcount_inc_not_zero()
63 new = old + 1; in refcount_inc_not_zero()
64 } while (atomic_cmpxchg(&rc->rc_count, old, new) != old); in refcount_inc_not_zero()
66 return old; in refcount_inc_not_zero()
72 unsigned old, new; in refcount_dec_and_test() local
75 old = atomic_read(&rc->rc_count); in refcount_dec_and_test()
76 KASSERT(old); in refcount_dec_and_test()
77 new = old - 1; in refcount_dec_and_test()
78 } while (atomic_cmpxchg(&rc->rc_count, old, new) != old); in refcount_dec_and_test()
80 return old == 1; in refcount_dec_and_test()
94 unsigned old, new; in refcount_dec_and_mutex_lock() local
97 old = atomic_read(&rc->rc_count); in refcount_dec_and_mutex_lock()
98 KASSERT(old); in refcount_dec_and_mutex_lock()
99 if (old == 1) { in refcount_dec_and_mutex_lock()
106 new = old - 1; in refcount_dec_and_mutex_lock()
107 } while (atomic_cmpxchg(&rc->rc_count, old, new) != old); in refcount_dec_and_mutex_lock()
109 KASSERT(old != 1); in refcount_dec_and_mutex_lock()