diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2009-12-03 15:52:18 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2009-12-14 17:55:33 -0500 |
commit | 9c1721aa4994f6625decbd915241f3a94ee2fe67 (patch) | |
tree | bc1c2d623ac5d0db82df18163f6ab029e057c558 /include/linux/rwlock_api_smp.h | |
parent | 9828ea9d75c38fe3dce05d00566eed61c85732e6 (diff) |
locking: Cleanup the name space completely
Make the name space hierarchy of locking functions consistent:
raw_spin* -> _raw_spin* -> __raw_spin*
No functional change.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/rwlock_api_smp.h')
-rw-r--r-- | include/linux/rwlock_api_smp.h | 113 |
1 files changed, 59 insertions, 54 deletions
diff --git a/include/linux/rwlock_api_smp.h b/include/linux/rwlock_api_smp.h index b3ba5ae6a8c4..9c9f0495d37c 100644 --- a/include/linux/rwlock_api_smp.h +++ b/include/linux/rwlock_api_smp.h | |||
@@ -15,102 +15,106 @@ | |||
15 | * Released under the General Public License (GPL). | 15 | * Released under the General Public License (GPL). |
16 | */ | 16 | */ |
17 | 17 | ||
18 | void __lockfunc _read_lock(rwlock_t *lock) __acquires(lock); | 18 | void __lockfunc _raw_read_lock(rwlock_t *lock) __acquires(lock); |
19 | void __lockfunc _write_lock(rwlock_t *lock) __acquires(lock); | 19 | void __lockfunc _raw_write_lock(rwlock_t *lock) __acquires(lock); |
20 | void __lockfunc _read_lock_bh(rwlock_t *lock) __acquires(lock); | 20 | void __lockfunc _raw_read_lock_bh(rwlock_t *lock) __acquires(lock); |
21 | void __lockfunc _write_lock_bh(rwlock_t *lock) __acquires(lock); | 21 | void __lockfunc _raw_write_lock_bh(rwlock_t *lock) __acquires(lock); |
22 | void __lockfunc _read_lock_irq(rwlock_t *lock) __acquires(lock); | 22 | void __lockfunc _raw_read_lock_irq(rwlock_t *lock) __acquires(lock); |
23 | void __lockfunc _write_lock_irq(rwlock_t *lock) __acquires(lock); | 23 | void __lockfunc _raw_write_lock_irq(rwlock_t *lock) __acquires(lock); |
24 | unsigned long __lockfunc _read_lock_irqsave(rwlock_t *lock) | 24 | unsigned long __lockfunc _raw_read_lock_irqsave(rwlock_t *lock) |
25 | __acquires(lock); | 25 | __acquires(lock); |
26 | unsigned long __lockfunc _write_lock_irqsave(rwlock_t *lock) | 26 | unsigned long __lockfunc _raw_write_lock_irqsave(rwlock_t *lock) |
27 | __acquires(lock); | 27 | __acquires(lock); |
28 | int __lockfunc _read_trylock(rwlock_t *lock); | 28 | int __lockfunc _raw_read_trylock(rwlock_t *lock); |
29 | int __lockfunc _write_trylock(rwlock_t *lock); | 29 | int __lockfunc _raw_write_trylock(rwlock_t *lock); |
30 | void __lockfunc _read_unlock(rwlock_t *lock) __releases(lock); | 30 | void __lockfunc _raw_read_unlock(rwlock_t *lock) __releases(lock); |
31 | void __lockfunc _write_unlock(rwlock_t *lock) __releases(lock); | 31 | void __lockfunc _raw_write_unlock(rwlock_t *lock) __releases(lock); |
32 | void __lockfunc _read_unlock_bh(rwlock_t *lock) __releases(lock); | 32 | void __lockfunc _raw_read_unlock_bh(rwlock_t *lock) __releases(lock); |
33 | void __lockfunc _write_unlock_bh(rwlock_t *lock) __releases(lock); | 33 | void __lockfunc _raw_write_unlock_bh(rwlock_t *lock) __releases(lock); |
34 | void __lockfunc _read_unlock_irq(rwlock_t *lock) __releases(lock); | 34 | void __lockfunc _raw_read_unlock_irq(rwlock_t *lock) __releases(lock); |
35 | void __lockfunc _write_unlock_irq(rwlock_t *lock) __releases(lock); | 35 | void __lockfunc _raw_write_unlock_irq(rwlock_t *lock) __releases(lock); |
36 | void __lockfunc _read_unlock_irqrestore(rwlock_t *lock, unsigned long flags) | 36 | void __lockfunc |
37 | _raw_read_unlock_irqrestore(rwlock_t *lock, unsigned long flags) | ||
37 | __releases(lock); | 38 | __releases(lock); |
38 | void __lockfunc _write_unlock_irqrestore(rwlock_t *lock, unsigned long flags) | 39 | void __lockfunc |
40 | _raw_write_unlock_irqrestore(rwlock_t *lock, unsigned long flags) | ||
39 | __releases(lock); | 41 | __releases(lock); |
40 | 42 | ||
41 | #ifdef CONFIG_INLINE_READ_LOCK | 43 | #ifdef CONFIG_INLINE_READ_LOCK |
42 | #define _read_lock(lock) __read_lock(lock) | 44 | #define _raw_read_lock(lock) __raw_read_lock(lock) |
43 | #endif | 45 | #endif |
44 | 46 | ||
45 | #ifdef CONFIG_INLINE_WRITE_LOCK | 47 | #ifdef CONFIG_INLINE_WRITE_LOCK |
46 | #define _write_lock(lock) __write_lock(lock) | 48 | #define _raw_write_lock(lock) __raw_write_lock(lock) |
47 | #endif | 49 | #endif |
48 | 50 | ||
49 | #ifdef CONFIG_INLINE_READ_LOCK_BH | 51 | #ifdef CONFIG_INLINE_READ_LOCK_BH |
50 | #define _read_lock_bh(lock) __read_lock_bh(lock) | 52 | #define _raw_read_lock_bh(lock) __raw_read_lock_bh(lock) |
51 | #endif | 53 | #endif |
52 | 54 | ||
53 | #ifdef CONFIG_INLINE_WRITE_LOCK_BH | 55 | #ifdef CONFIG_INLINE_WRITE_LOCK_BH |
54 | #define _write_lock_bh(lock) __write_lock_bh(lock) | 56 | #define _raw_write_lock_bh(lock) __raw_write_lock_bh(lock) |
55 | #endif | 57 | #endif |
56 | 58 | ||
57 | #ifdef CONFIG_INLINE_READ_LOCK_IRQ | 59 | #ifdef CONFIG_INLINE_READ_LOCK_IRQ |
58 | #define _read_lock_irq(lock) __read_lock_irq(lock) | 60 | #define _raw_read_lock_irq(lock) __raw_read_lock_irq(lock) |
59 | #endif | 61 | #endif |
60 | 62 | ||
61 | #ifdef CONFIG_INLINE_WRITE_LOCK_IRQ | 63 | #ifdef CONFIG_INLINE_WRITE_LOCK_IRQ |
62 | #define _write_lock_irq(lock) __write_lock_irq(lock) | 64 | #define _raw_write_lock_irq(lock) __raw_write_lock_irq(lock) |
63 | #endif | 65 | #endif |
64 | 66 | ||
65 | #ifdef CONFIG_INLINE_READ_LOCK_IRQSAVE | 67 | #ifdef CONFIG_INLINE_READ_LOCK_IRQSAVE |
66 | #define _read_lock_irqsave(lock) __read_lock_irqsave(lock) | 68 | #define _raw_read_lock_irqsave(lock) __raw_read_lock_irqsave(lock) |
67 | #endif | 69 | #endif |
68 | 70 | ||
69 | #ifdef CONFIG_INLINE_WRITE_LOCK_IRQSAVE | 71 | #ifdef CONFIG_INLINE_WRITE_LOCK_IRQSAVE |
70 | #define _write_lock_irqsave(lock) __write_lock_irqsave(lock) | 72 | #define _raw_write_lock_irqsave(lock) __raw_write_lock_irqsave(lock) |
71 | #endif | 73 | #endif |
72 | 74 | ||
73 | #ifdef CONFIG_INLINE_READ_TRYLOCK | 75 | #ifdef CONFIG_INLINE_READ_TRYLOCK |
74 | #define _read_trylock(lock) __read_trylock(lock) | 76 | #define _raw_read_trylock(lock) __raw_read_trylock(lock) |
75 | #endif | 77 | #endif |
76 | 78 | ||
77 | #ifdef CONFIG_INLINE_WRITE_TRYLOCK | 79 | #ifdef CONFIG_INLINE_WRITE_TRYLOCK |
78 | #define _write_trylock(lock) __write_trylock(lock) | 80 | #define _raw_write_trylock(lock) __raw_write_trylock(lock) |
79 | #endif | 81 | #endif |
80 | 82 | ||
81 | #ifdef CONFIG_INLINE_READ_UNLOCK | 83 | #ifdef CONFIG_INLINE_READ_UNLOCK |
82 | #define _read_unlock(lock) __read_unlock(lock) | 84 | #define _raw_read_unlock(lock) __raw_read_unlock(lock) |
83 | #endif | 85 | #endif |
84 | 86 | ||
85 | #ifdef CONFIG_INLINE_WRITE_UNLOCK | 87 | #ifdef CONFIG_INLINE_WRITE_UNLOCK |
86 | #define _write_unlock(lock) __write_unlock(lock) | 88 | #define _raw_write_unlock(lock) __raw_write_unlock(lock) |
87 | #endif | 89 | #endif |
88 | 90 | ||
89 | #ifdef CONFIG_INLINE_READ_UNLOCK_BH | 91 | #ifdef CONFIG_INLINE_READ_UNLOCK_BH |
90 | #define _read_unlock_bh(lock) __read_unlock_bh(lock) | 92 | #define _raw_read_unlock_bh(lock) __raw_read_unlock_bh(lock) |
91 | #endif | 93 | #endif |
92 | 94 | ||
93 | #ifdef CONFIG_INLINE_WRITE_UNLOCK_BH | 95 | #ifdef CONFIG_INLINE_WRITE_UNLOCK_BH |
94 | #define _write_unlock_bh(lock) __write_unlock_bh(lock) | 96 | #define _raw_write_unlock_bh(lock) __raw_write_unlock_bh(lock) |
95 | #endif | 97 | #endif |
96 | 98 | ||
97 | #ifdef CONFIG_INLINE_READ_UNLOCK_IRQ | 99 | #ifdef CONFIG_INLINE_READ_UNLOCK_IRQ |
98 | #define _read_unlock_irq(lock) __read_unlock_irq(lock) | 100 | #define _raw_read_unlock_irq(lock) __raw_read_unlock_irq(lock) |
99 | #endif | 101 | #endif |
100 | 102 | ||
101 | #ifdef CONFIG_INLINE_WRITE_UNLOCK_IRQ | 103 | #ifdef CONFIG_INLINE_WRITE_UNLOCK_IRQ |
102 | #define _write_unlock_irq(lock) __write_unlock_irq(lock) | 104 | #define _raw_write_unlock_irq(lock) __raw_write_unlock_irq(lock) |
103 | #endif | 105 | #endif |
104 | 106 | ||
105 | #ifdef CONFIG_INLINE_READ_UNLOCK_IRQRESTORE | 107 | #ifdef CONFIG_INLINE_READ_UNLOCK_IRQRESTORE |
106 | #define _read_unlock_irqrestore(lock, flags) __read_unlock_irqrestore(lock, flags) | 108 | #define _raw_read_unlock_irqrestore(lock, flags) \ |
109 | __raw_read_unlock_irqrestore(lock, flags) | ||
107 | #endif | 110 | #endif |
108 | 111 | ||
109 | #ifdef CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE | 112 | #ifdef CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE |
110 | #define _write_unlock_irqrestore(lock, flags) __write_unlock_irqrestore(lock, flags) | 113 | #define _raw_write_unlock_irqrestore(lock, flags) \ |
114 | __raw_write_unlock_irqrestore(lock, flags) | ||
111 | #endif | 115 | #endif |
112 | 116 | ||
113 | static inline int __read_trylock(rwlock_t *lock) | 117 | static inline int __raw_read_trylock(rwlock_t *lock) |
114 | { | 118 | { |
115 | preempt_disable(); | 119 | preempt_disable(); |
116 | if (do_raw_read_trylock(lock)) { | 120 | if (do_raw_read_trylock(lock)) { |
@@ -121,7 +125,7 @@ static inline int __read_trylock(rwlock_t *lock) | |||
121 | return 0; | 125 | return 0; |
122 | } | 126 | } |
123 | 127 | ||
124 | static inline int __write_trylock(rwlock_t *lock) | 128 | static inline int __raw_write_trylock(rwlock_t *lock) |
125 | { | 129 | { |
126 | preempt_disable(); | 130 | preempt_disable(); |
127 | if (do_raw_write_trylock(lock)) { | 131 | if (do_raw_write_trylock(lock)) { |
@@ -139,14 +143,14 @@ static inline int __write_trylock(rwlock_t *lock) | |||
139 | */ | 143 | */ |
140 | #if !defined(CONFIG_GENERIC_LOCKBREAK) || defined(CONFIG_DEBUG_LOCK_ALLOC) | 144 | #if !defined(CONFIG_GENERIC_LOCKBREAK) || defined(CONFIG_DEBUG_LOCK_ALLOC) |
141 | 145 | ||
142 | static inline void __read_lock(rwlock_t *lock) | 146 | static inline void __raw_read_lock(rwlock_t *lock) |
143 | { | 147 | { |
144 | preempt_disable(); | 148 | preempt_disable(); |
145 | rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); | 149 | rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); |
146 | LOCK_CONTENDED(lock, do_raw_read_trylock, do_raw_read_lock); | 150 | LOCK_CONTENDED(lock, do_raw_read_trylock, do_raw_read_lock); |
147 | } | 151 | } |
148 | 152 | ||
149 | static inline unsigned long __read_lock_irqsave(rwlock_t *lock) | 153 | static inline unsigned long __raw_read_lock_irqsave(rwlock_t *lock) |
150 | { | 154 | { |
151 | unsigned long flags; | 155 | unsigned long flags; |
152 | 156 | ||
@@ -158,7 +162,7 @@ static inline unsigned long __read_lock_irqsave(rwlock_t *lock) | |||
158 | return flags; | 162 | return flags; |
159 | } | 163 | } |
160 | 164 | ||
161 | static inline void __read_lock_irq(rwlock_t *lock) | 165 | static inline void __raw_read_lock_irq(rwlock_t *lock) |
162 | { | 166 | { |
163 | local_irq_disable(); | 167 | local_irq_disable(); |
164 | preempt_disable(); | 168 | preempt_disable(); |
@@ -166,7 +170,7 @@ static inline void __read_lock_irq(rwlock_t *lock) | |||
166 | LOCK_CONTENDED(lock, do_raw_read_trylock, do_raw_read_lock); | 170 | LOCK_CONTENDED(lock, do_raw_read_trylock, do_raw_read_lock); |
167 | } | 171 | } |
168 | 172 | ||
169 | static inline void __read_lock_bh(rwlock_t *lock) | 173 | static inline void __raw_read_lock_bh(rwlock_t *lock) |
170 | { | 174 | { |
171 | local_bh_disable(); | 175 | local_bh_disable(); |
172 | preempt_disable(); | 176 | preempt_disable(); |
@@ -174,7 +178,7 @@ static inline void __read_lock_bh(rwlock_t *lock) | |||
174 | LOCK_CONTENDED(lock, do_raw_read_trylock, do_raw_read_lock); | 178 | LOCK_CONTENDED(lock, do_raw_read_trylock, do_raw_read_lock); |
175 | } | 179 | } |
176 | 180 | ||
177 | static inline unsigned long __write_lock_irqsave(rwlock_t *lock) | 181 | static inline unsigned long __raw_write_lock_irqsave(rwlock_t *lock) |
178 | { | 182 | { |
179 | unsigned long flags; | 183 | unsigned long flags; |
180 | 184 | ||
@@ -186,7 +190,7 @@ static inline unsigned long __write_lock_irqsave(rwlock_t *lock) | |||
186 | return flags; | 190 | return flags; |
187 | } | 191 | } |
188 | 192 | ||
189 | static inline void __write_lock_irq(rwlock_t *lock) | 193 | static inline void __raw_write_lock_irq(rwlock_t *lock) |
190 | { | 194 | { |
191 | local_irq_disable(); | 195 | local_irq_disable(); |
192 | preempt_disable(); | 196 | preempt_disable(); |
@@ -194,7 +198,7 @@ static inline void __write_lock_irq(rwlock_t *lock) | |||
194 | LOCK_CONTENDED(lock, do_raw_write_trylock, do_raw_write_lock); | 198 | LOCK_CONTENDED(lock, do_raw_write_trylock, do_raw_write_lock); |
195 | } | 199 | } |
196 | 200 | ||
197 | static inline void __write_lock_bh(rwlock_t *lock) | 201 | static inline void __raw_write_lock_bh(rwlock_t *lock) |
198 | { | 202 | { |
199 | local_bh_disable(); | 203 | local_bh_disable(); |
200 | preempt_disable(); | 204 | preempt_disable(); |
@@ -202,7 +206,7 @@ static inline void __write_lock_bh(rwlock_t *lock) | |||
202 | LOCK_CONTENDED(lock, do_raw_write_trylock, do_raw_write_lock); | 206 | LOCK_CONTENDED(lock, do_raw_write_trylock, do_raw_write_lock); |
203 | } | 207 | } |
204 | 208 | ||
205 | static inline void __write_lock(rwlock_t *lock) | 209 | static inline void __raw_write_lock(rwlock_t *lock) |
206 | { | 210 | { |
207 | preempt_disable(); | 211 | preempt_disable(); |
208 | rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); | 212 | rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); |
@@ -211,21 +215,22 @@ static inline void __write_lock(rwlock_t *lock) | |||
211 | 215 | ||
212 | #endif /* CONFIG_PREEMPT */ | 216 | #endif /* CONFIG_PREEMPT */ |
213 | 217 | ||
214 | static inline void __write_unlock(rwlock_t *lock) | 218 | static inline void __raw_write_unlock(rwlock_t *lock) |
215 | { | 219 | { |
216 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | 220 | rwlock_release(&lock->dep_map, 1, _RET_IP_); |
217 | do_raw_write_unlock(lock); | 221 | do_raw_write_unlock(lock); |
218 | preempt_enable(); | 222 | preempt_enable(); |
219 | } | 223 | } |
220 | 224 | ||
221 | static inline void __read_unlock(rwlock_t *lock) | 225 | static inline void __raw_read_unlock(rwlock_t *lock) |
222 | { | 226 | { |
223 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | 227 | rwlock_release(&lock->dep_map, 1, _RET_IP_); |
224 | do_raw_read_unlock(lock); | 228 | do_raw_read_unlock(lock); |
225 | preempt_enable(); | 229 | preempt_enable(); |
226 | } | 230 | } |
227 | 231 | ||
228 | static inline void __read_unlock_irqrestore(rwlock_t *lock, unsigned long flags) | 232 | static inline void |
233 | __raw_read_unlock_irqrestore(rwlock_t *lock, unsigned long flags) | ||
229 | { | 234 | { |
230 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | 235 | rwlock_release(&lock->dep_map, 1, _RET_IP_); |
231 | do_raw_read_unlock(lock); | 236 | do_raw_read_unlock(lock); |
@@ -233,7 +238,7 @@ static inline void __read_unlock_irqrestore(rwlock_t *lock, unsigned long flags) | |||
233 | preempt_enable(); | 238 | preempt_enable(); |
234 | } | 239 | } |
235 | 240 | ||
236 | static inline void __read_unlock_irq(rwlock_t *lock) | 241 | static inline void __raw_read_unlock_irq(rwlock_t *lock) |
237 | { | 242 | { |
238 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | 243 | rwlock_release(&lock->dep_map, 1, _RET_IP_); |
239 | do_raw_read_unlock(lock); | 244 | do_raw_read_unlock(lock); |
@@ -241,7 +246,7 @@ static inline void __read_unlock_irq(rwlock_t *lock) | |||
241 | preempt_enable(); | 246 | preempt_enable(); |
242 | } | 247 | } |
243 | 248 | ||
244 | static inline void __read_unlock_bh(rwlock_t *lock) | 249 | static inline void __raw_read_unlock_bh(rwlock_t *lock) |
245 | { | 250 | { |
246 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | 251 | rwlock_release(&lock->dep_map, 1, _RET_IP_); |
247 | do_raw_read_unlock(lock); | 252 | do_raw_read_unlock(lock); |
@@ -249,7 +254,7 @@ static inline void __read_unlock_bh(rwlock_t *lock) | |||
249 | local_bh_enable_ip((unsigned long)__builtin_return_address(0)); | 254 | local_bh_enable_ip((unsigned long)__builtin_return_address(0)); |
250 | } | 255 | } |
251 | 256 | ||
252 | static inline void __write_unlock_irqrestore(rwlock_t *lock, | 257 | static inline void __raw_write_unlock_irqrestore(rwlock_t *lock, |
253 | unsigned long flags) | 258 | unsigned long flags) |
254 | { | 259 | { |
255 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | 260 | rwlock_release(&lock->dep_map, 1, _RET_IP_); |
@@ -258,7 +263,7 @@ static inline void __write_unlock_irqrestore(rwlock_t *lock, | |||
258 | preempt_enable(); | 263 | preempt_enable(); |
259 | } | 264 | } |
260 | 265 | ||
261 | static inline void __write_unlock_irq(rwlock_t *lock) | 266 | static inline void __raw_write_unlock_irq(rwlock_t *lock) |
262 | { | 267 | { |
263 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | 268 | rwlock_release(&lock->dep_map, 1, _RET_IP_); |
264 | do_raw_write_unlock(lock); | 269 | do_raw_write_unlock(lock); |
@@ -266,7 +271,7 @@ static inline void __write_unlock_irq(rwlock_t *lock) | |||
266 | preempt_enable(); | 271 | preempt_enable(); |
267 | } | 272 | } |
268 | 273 | ||
269 | static inline void __write_unlock_bh(rwlock_t *lock) | 274 | static inline void __raw_write_unlock_bh(rwlock_t *lock) |
270 | { | 275 | { |
271 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | 276 | rwlock_release(&lock->dep_map, 1, _RET_IP_); |
272 | do_raw_write_unlock(lock); | 277 | do_raw_write_unlock(lock); |