Lines Matching refs:lockref

12 	struct lockref old;							\
14 old.lock_count = READ_ONCE(lockref->lock_count); \
16 struct lockref new = old, prev = old; \
18 old.lock_count = cmpxchg64_relaxed(&lockref->lock_count, \
41 void lockref_get(struct lockref *lockref) in lockref_get() argument
49 spin_lock(&lockref->lock); in lockref_get()
50 lockref->count++; in lockref_get()
51 spin_unlock(&lockref->lock); in lockref_get()
60 int lockref_get_not_zero(struct lockref *lockref) in lockref_get_not_zero() argument
72 spin_lock(&lockref->lock); in lockref_get_not_zero()
74 if (lockref->count > 0) { in lockref_get_not_zero()
75 lockref->count++; in lockref_get_not_zero()
78 spin_unlock(&lockref->lock); in lockref_get_not_zero()
88 int lockref_put_not_zero(struct lockref *lockref) in lockref_put_not_zero() argument
100 spin_lock(&lockref->lock); in lockref_put_not_zero()
102 if (lockref->count > 1) { in lockref_put_not_zero()
103 lockref->count--; in lockref_put_not_zero()
106 spin_unlock(&lockref->lock); in lockref_put_not_zero()
117 int lockref_get_or_lock(struct lockref *lockref) in lockref_get_or_lock() argument
127 spin_lock(&lockref->lock); in lockref_get_or_lock()
128 if (lockref->count <= 0) in lockref_get_or_lock()
130 lockref->count++; in lockref_get_or_lock()
131 spin_unlock(&lockref->lock); in lockref_get_or_lock()
143 int lockref_put_return(struct lockref *lockref) in lockref_put_return() argument
161 int lockref_put_or_lock(struct lockref *lockref) in lockref_put_or_lock() argument
171 spin_lock(&lockref->lock); in lockref_put_or_lock()
172 if (lockref->count <= 1) in lockref_put_or_lock()
174 lockref->count--; in lockref_put_or_lock()
175 spin_unlock(&lockref->lock); in lockref_put_or_lock()
184 void lockref_mark_dead(struct lockref *lockref) in lockref_mark_dead() argument
186 assert_spin_locked(&lockref->lock); in lockref_mark_dead()
187 lockref->count = -128; in lockref_mark_dead()
196 int lockref_get_not_dead(struct lockref *lockref) in lockref_get_not_dead() argument
208 spin_lock(&lockref->lock); in lockref_get_not_dead()
210 if (lockref->count >= 0) { in lockref_get_not_dead()
211 lockref->count++; in lockref_get_not_dead()
214 spin_unlock(&lockref->lock); in lockref_get_not_dead()