Searched refs:lockref (Results 1 - 9 of 9) sorted by relevance

/linux-4.4.14/lib/
H A Dlockref.c2 #include <linux/lockref.h>
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, \
35 * @lockref: pointer to lockref structure
40 void lockref_get(struct lockref *lockref) lockref_get() argument
48 spin_lock(&lockref->lock); lockref_get()
49 lockref->count++; lockref_get()
50 spin_unlock(&lockref->lock); lockref_get()
56 * @lockref: pointer to lockref structure
59 int lockref_get_not_zero(struct lockref *lockref) lockref_get_not_zero() argument
71 spin_lock(&lockref->lock); lockref_get_not_zero()
73 if (lockref->count > 0) { lockref_get_not_zero()
74 lockref->count++; lockref_get_not_zero()
77 spin_unlock(&lockref->lock); lockref_get_not_zero()
84 * @lockref: pointer to lockref structure
88 int lockref_get_or_lock(struct lockref *lockref) lockref_get_or_lock() argument
98 spin_lock(&lockref->lock); lockref_get_or_lock()
99 if (lockref->count <= 0) lockref_get_or_lock()
101 lockref->count++; lockref_get_or_lock()
102 spin_unlock(&lockref->lock); lockref_get_or_lock()
109 * @lockref: pointer to lockref structure
112 * If the lockref was dead or locked, return an error.
114 int lockref_put_return(struct lockref *lockref) lockref_put_return() argument
129 * @lockref: pointer to lockref structure
132 int lockref_put_or_lock(struct lockref *lockref) lockref_put_or_lock() argument
142 spin_lock(&lockref->lock); lockref_put_or_lock()
143 if (lockref->count <= 1) lockref_put_or_lock()
145 lockref->count--; lockref_put_or_lock()
146 spin_unlock(&lockref->lock); lockref_put_or_lock()
152 * lockref_mark_dead - mark lockref dead
153 * @lockref: pointer to lockref structure
155 void lockref_mark_dead(struct lockref *lockref) lockref_mark_dead() argument
157 assert_spin_locked(&lockref->lock); lockref_mark_dead()
158 lockref->count = -128; lockref_mark_dead()
164 * @lockref: pointer to lockref structure
165 * Return: 1 if count updated successfully or 0 if lockref was dead
167 int lockref_get_not_dead(struct lockref *lockref) lockref_get_not_dead() argument
179 spin_lock(&lockref->lock); lockref_get_not_dead()
181 if (lockref->count >= 0) { lockref_get_not_dead()
182 lockref->count++; lockref_get_not_dead()
185 spin_unlock(&lockref->lock); lockref_get_not_dead()
H A DMakefile23 obj-y += lockref.o
/linux-4.4.14/include/linux/
H A Dlockref.h24 struct lockref { struct
36 extern void lockref_get(struct lockref *);
37 extern int lockref_put_return(struct lockref *);
38 extern int lockref_get_not_zero(struct lockref *);
39 extern int lockref_get_or_lock(struct lockref *);
40 extern int lockref_put_or_lock(struct lockref *);
42 extern void lockref_mark_dead(struct lockref *);
43 extern int lockref_get_not_dead(struct lockref *);
46 static inline int __lockref_is_dead(const struct lockref *l) __lockref_is_dead()
H A Ddcache.h12 #include <linux/lockref.h>
120 struct lockref d_lockref; /* per-dentry lock and refcount */
/linux-4.4.14/include/asm-generic/
H A Dqspinlock.h62 * locked wrt the lockref code to avoid lock stealing by the lockref
64 * optimizations to be applied without conflict with lockref.
/linux-4.4.14/fs/gfs2/
H A Dincore.h24 #include <linux/lockref.h>
336 struct lockref gl_lockref;
444 struct lockref qd_lockref;
H A Dquota.c55 #include <linux/lockref.h>
81 /* Lock order: qd_lock -> bucket lock -> qd->lockref.lock -> lru lock */
H A Dglock.c36 #include <linux/lockref.h>
/linux-4.4.14/fs/
H A Ddcache.c641 * lockref optimistically. fast_dput()

Completed in 870 milliseconds