aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/rwlock_api_smp.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2009-12-03 14:55:53 -0500
committerThomas Gleixner <tglx@linutronix.de>2009-12-14 17:55:33 -0500
commit9828ea9d75c38fe3dce05d00566eed61c85732e6 (patch)
tree6cee5c8ffb07cdf45cc12d58f74a3053ffefcb5f /include/linux/rwlock_api_smp.h
parent5f6384c5fb6bfc9aac506e058974d3ba293951b3 (diff)
locking: Further name space cleanups
The name space hierarchy for the internal lock functions is now a bit backwards. raw_spin* functions map to _spin* which use __spin*, while we would like to have _raw_spin* and __raw_spin*. _raw_spin* is already used by lock debugging, so rename those funtions to do_raw_spin* to free up the _raw_spin* name space. 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.h40
1 files changed, 20 insertions, 20 deletions
diff --git a/include/linux/rwlock_api_smp.h b/include/linux/rwlock_api_smp.h
index 090f876f828d..b3ba5ae6a8c4 100644
--- a/include/linux/rwlock_api_smp.h
+++ b/include/linux/rwlock_api_smp.h
@@ -113,7 +113,7 @@ void __lockfunc _write_unlock_irqrestore(rwlock_t *lock, unsigned long flags)
113static inline int __read_trylock(rwlock_t *lock) 113static inline int __read_trylock(rwlock_t *lock)
114{ 114{
115 preempt_disable(); 115 preempt_disable();
116 if (_raw_read_trylock(lock)) { 116 if (do_raw_read_trylock(lock)) {
117 rwlock_acquire_read(&lock->dep_map, 0, 1, _RET_IP_); 117 rwlock_acquire_read(&lock->dep_map, 0, 1, _RET_IP_);
118 return 1; 118 return 1;
119 } 119 }
@@ -124,7 +124,7 @@ static inline int __read_trylock(rwlock_t *lock)
124static inline int __write_trylock(rwlock_t *lock) 124static inline int __write_trylock(rwlock_t *lock)
125{ 125{
126 preempt_disable(); 126 preempt_disable();
127 if (_raw_write_trylock(lock)) { 127 if (do_raw_write_trylock(lock)) {
128 rwlock_acquire(&lock->dep_map, 0, 1, _RET_IP_); 128 rwlock_acquire(&lock->dep_map, 0, 1, _RET_IP_);
129 return 1; 129 return 1;
130 } 130 }
@@ -143,7 +143,7 @@ static inline void __read_lock(rwlock_t *lock)
143{ 143{
144 preempt_disable(); 144 preempt_disable();
145 rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); 145 rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_);
146 LOCK_CONTENDED(lock, _raw_read_trylock, _raw_read_lock); 146 LOCK_CONTENDED(lock, do_raw_read_trylock, do_raw_read_lock);
147} 147}
148 148
149static inline unsigned long __read_lock_irqsave(rwlock_t *lock) 149static inline unsigned long __read_lock_irqsave(rwlock_t *lock)
@@ -153,8 +153,8 @@ static inline unsigned long __read_lock_irqsave(rwlock_t *lock)
153 local_irq_save(flags); 153 local_irq_save(flags);
154 preempt_disable(); 154 preempt_disable();
155 rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); 155 rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_);
156 LOCK_CONTENDED_FLAGS(lock, _raw_read_trylock, _raw_read_lock, 156 LOCK_CONTENDED_FLAGS(lock, do_raw_read_trylock, do_raw_read_lock,
157 _raw_read_lock_flags, &flags); 157 do_raw_read_lock_flags, &flags);
158 return flags; 158 return flags;
159} 159}
160 160
@@ -163,7 +163,7 @@ static inline void __read_lock_irq(rwlock_t *lock)
163 local_irq_disable(); 163 local_irq_disable();
164 preempt_disable(); 164 preempt_disable();
165 rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); 165 rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_);
166 LOCK_CONTENDED(lock, _raw_read_trylock, _raw_read_lock); 166 LOCK_CONTENDED(lock, do_raw_read_trylock, do_raw_read_lock);
167} 167}
168 168
169static inline void __read_lock_bh(rwlock_t *lock) 169static inline void __read_lock_bh(rwlock_t *lock)
@@ -171,7 +171,7 @@ static inline void __read_lock_bh(rwlock_t *lock)
171 local_bh_disable(); 171 local_bh_disable();
172 preempt_disable(); 172 preempt_disable();
173 rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); 173 rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_);
174 LOCK_CONTENDED(lock, _raw_read_trylock, _raw_read_lock); 174 LOCK_CONTENDED(lock, do_raw_read_trylock, do_raw_read_lock);
175} 175}
176 176
177static inline unsigned long __write_lock_irqsave(rwlock_t *lock) 177static inline unsigned long __write_lock_irqsave(rwlock_t *lock)
@@ -181,8 +181,8 @@ static inline unsigned long __write_lock_irqsave(rwlock_t *lock)
181 local_irq_save(flags); 181 local_irq_save(flags);
182 preempt_disable(); 182 preempt_disable();
183 rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); 183 rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_);
184 LOCK_CONTENDED_FLAGS(lock, _raw_write_trylock, _raw_write_lock, 184 LOCK_CONTENDED_FLAGS(lock, do_raw_write_trylock, do_raw_write_lock,
185 _raw_write_lock_flags, &flags); 185 do_raw_write_lock_flags, &flags);
186 return flags; 186 return flags;
187} 187}
188 188
@@ -191,7 +191,7 @@ static inline void __write_lock_irq(rwlock_t *lock)
191 local_irq_disable(); 191 local_irq_disable();
192 preempt_disable(); 192 preempt_disable();
193 rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); 193 rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_);
194 LOCK_CONTENDED(lock, _raw_write_trylock, _raw_write_lock); 194 LOCK_CONTENDED(lock, do_raw_write_trylock, do_raw_write_lock);
195} 195}
196 196
197static inline void __write_lock_bh(rwlock_t *lock) 197static inline void __write_lock_bh(rwlock_t *lock)
@@ -199,14 +199,14 @@ static inline void __write_lock_bh(rwlock_t *lock)
199 local_bh_disable(); 199 local_bh_disable();
200 preempt_disable(); 200 preempt_disable();
201 rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); 201 rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_);
202 LOCK_CONTENDED(lock, _raw_write_trylock, _raw_write_lock); 202 LOCK_CONTENDED(lock, do_raw_write_trylock, do_raw_write_lock);
203} 203}
204 204
205static inline void __write_lock(rwlock_t *lock) 205static inline void __write_lock(rwlock_t *lock)
206{ 206{
207 preempt_disable(); 207 preempt_disable();
208 rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); 208 rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_);
209 LOCK_CONTENDED(lock, _raw_write_trylock, _raw_write_lock); 209 LOCK_CONTENDED(lock, do_raw_write_trylock, do_raw_write_lock);
210} 210}
211 211
212#endif /* CONFIG_PREEMPT */ 212#endif /* CONFIG_PREEMPT */
@@ -214,21 +214,21 @@ static inline void __write_lock(rwlock_t *lock)
214static inline void __write_unlock(rwlock_t *lock) 214static inline void __write_unlock(rwlock_t *lock)
215{ 215{
216 rwlock_release(&lock->dep_map, 1, _RET_IP_); 216 rwlock_release(&lock->dep_map, 1, _RET_IP_);
217 _raw_write_unlock(lock); 217 do_raw_write_unlock(lock);
218 preempt_enable(); 218 preempt_enable();
219} 219}
220 220
221static inline void __read_unlock(rwlock_t *lock) 221static inline void __read_unlock(rwlock_t *lock)
222{ 222{
223 rwlock_release(&lock->dep_map, 1, _RET_IP_); 223 rwlock_release(&lock->dep_map, 1, _RET_IP_);
224 _raw_read_unlock(lock); 224 do_raw_read_unlock(lock);
225 preempt_enable(); 225 preempt_enable();
226} 226}
227 227
228static inline void __read_unlock_irqrestore(rwlock_t *lock, unsigned long flags) 228static inline void __read_unlock_irqrestore(rwlock_t *lock, unsigned long flags)
229{ 229{
230 rwlock_release(&lock->dep_map, 1, _RET_IP_); 230 rwlock_release(&lock->dep_map, 1, _RET_IP_);
231 _raw_read_unlock(lock); 231 do_raw_read_unlock(lock);
232 local_irq_restore(flags); 232 local_irq_restore(flags);
233 preempt_enable(); 233 preempt_enable();
234} 234}
@@ -236,7 +236,7 @@ static inline void __read_unlock_irqrestore(rwlock_t *lock, unsigned long flags)
236static inline void __read_unlock_irq(rwlock_t *lock) 236static inline void __read_unlock_irq(rwlock_t *lock)
237{ 237{
238 rwlock_release(&lock->dep_map, 1, _RET_IP_); 238 rwlock_release(&lock->dep_map, 1, _RET_IP_);
239 _raw_read_unlock(lock); 239 do_raw_read_unlock(lock);
240 local_irq_enable(); 240 local_irq_enable();
241 preempt_enable(); 241 preempt_enable();
242} 242}
@@ -244,7 +244,7 @@ static inline void __read_unlock_irq(rwlock_t *lock)
244static inline void __read_unlock_bh(rwlock_t *lock) 244static inline void __read_unlock_bh(rwlock_t *lock)
245{ 245{
246 rwlock_release(&lock->dep_map, 1, _RET_IP_); 246 rwlock_release(&lock->dep_map, 1, _RET_IP_);
247 _raw_read_unlock(lock); 247 do_raw_read_unlock(lock);
248 preempt_enable_no_resched(); 248 preempt_enable_no_resched();
249 local_bh_enable_ip((unsigned long)__builtin_return_address(0)); 249 local_bh_enable_ip((unsigned long)__builtin_return_address(0));
250} 250}
@@ -253,7 +253,7 @@ static inline void __write_unlock_irqrestore(rwlock_t *lock,
253 unsigned long flags) 253 unsigned long flags)
254{ 254{
255 rwlock_release(&lock->dep_map, 1, _RET_IP_); 255 rwlock_release(&lock->dep_map, 1, _RET_IP_);
256 _raw_write_unlock(lock); 256 do_raw_write_unlock(lock);
257 local_irq_restore(flags); 257 local_irq_restore(flags);
258 preempt_enable(); 258 preempt_enable();
259} 259}
@@ -261,7 +261,7 @@ static inline void __write_unlock_irqrestore(rwlock_t *lock,
261static inline void __write_unlock_irq(rwlock_t *lock) 261static inline void __write_unlock_irq(rwlock_t *lock)
262{ 262{
263 rwlock_release(&lock->dep_map, 1, _RET_IP_); 263 rwlock_release(&lock->dep_map, 1, _RET_IP_);
264 _raw_write_unlock(lock); 264 do_raw_write_unlock(lock);
265 local_irq_enable(); 265 local_irq_enable();
266 preempt_enable(); 266 preempt_enable();
267} 267}
@@ -269,7 +269,7 @@ static inline void __write_unlock_irq(rwlock_t *lock)
269static inline void __write_unlock_bh(rwlock_t *lock) 269static inline void __write_unlock_bh(rwlock_t *lock)
270{ 270{
271 rwlock_release(&lock->dep_map, 1, _RET_IP_); 271 rwlock_release(&lock->dep_map, 1, _RET_IP_);
272 _raw_write_unlock(lock); 272 do_raw_write_unlock(lock);
273 preempt_enable_no_resched(); 273 preempt_enable_no_resched();
274 local_bh_enable_ip((unsigned long)__builtin_return_address(0)); 274 local_bh_enable_ip((unsigned long)__builtin_return_address(0));
275} 275}