• Home
  • Raw
  • Download

Lines Matching refs:lockref

11 	struct lockref old;							\
13 old.lock_count = READ_ONCE(lockref->lock_count); \
15 struct lockref new = old, prev = old; \
17 old.lock_count = cmpxchg64_relaxed(&lockref->lock_count, \
40 void lockref_get(struct lockref *lockref) in lockref_get() argument
48 spin_lock(&lockref->lock); in lockref_get()
49 lockref->count++; in lockref_get()
50 spin_unlock(&lockref->lock); in lockref_get()
59 int lockref_get_not_zero(struct lockref *lockref) in lockref_get_not_zero() argument
71 spin_lock(&lockref->lock); in lockref_get_not_zero()
73 if (lockref->count > 0) { in lockref_get_not_zero()
74 lockref->count++; in lockref_get_not_zero()
77 spin_unlock(&lockref->lock); in lockref_get_not_zero()
88 int lockref_get_or_lock(struct lockref *lockref) in lockref_get_or_lock() argument
98 spin_lock(&lockref->lock); in lockref_get_or_lock()
99 if (lockref->count <= 0) in lockref_get_or_lock()
101 lockref->count++; in lockref_get_or_lock()
102 spin_unlock(&lockref->lock); in lockref_get_or_lock()
114 int lockref_put_return(struct lockref *lockref) in lockref_put_return() argument
132 int lockref_put_or_lock(struct lockref *lockref) in lockref_put_or_lock() argument
142 spin_lock(&lockref->lock); in lockref_put_or_lock()
143 if (lockref->count <= 1) in lockref_put_or_lock()
145 lockref->count--; in lockref_put_or_lock()
146 spin_unlock(&lockref->lock); in lockref_put_or_lock()
155 void lockref_mark_dead(struct lockref *lockref) in lockref_mark_dead() argument
157 assert_spin_locked(&lockref->lock); in lockref_mark_dead()
158 lockref->count = -128; in lockref_mark_dead()
167 int lockref_get_not_dead(struct lockref *lockref) in lockref_get_not_dead() argument
179 spin_lock(&lockref->lock); in lockref_get_not_dead()
181 if (lockref->count >= 0) { in lockref_get_not_dead()
182 lockref->count++; in lockref_get_not_dead()
185 spin_unlock(&lockref->lock); in lockref_get_not_dead()