Lines Matching refs:r
58 static inline void refcount_set(refcount_t *r, unsigned int n) in refcount_set() argument
60 atomic_set(&r->refs, n); in refcount_set()
63 static inline unsigned int refcount_read(const refcount_t *r) in refcount_read() argument
65 return atomic_read(&r->refs); in refcount_read()
76 bool refcount_inc_not_zero(refcount_t *r) in refcount_inc_not_zero() argument
78 unsigned int old, new, val = atomic_read(&r->refs); in refcount_inc_not_zero()
89 old = atomic_cmpxchg_relaxed(&r->refs, val, new); in refcount_inc_not_zero()
107 static inline void refcount_inc(refcount_t *r) in refcount_inc() argument
109 REFCOUNT_WARN(!refcount_inc_not_zero(r), "refcount_t: increment on 0; use-after-free.\n"); in refcount_inc()
121 bool refcount_sub_and_test(unsigned int i, refcount_t *r) in refcount_sub_and_test() argument
123 unsigned int old, new, val = atomic_read(&r->refs); in refcount_sub_and_test()
135 old = atomic_cmpxchg_release(&r->refs, val, new); in refcount_sub_and_test()
146 bool refcount_dec_and_test(refcount_t *r) in refcount_dec_and_test() argument
148 return refcount_sub_and_test(1, r); in refcount_dec_and_test()