diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-07-03 03:24:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-03 18:27:01 -0400 |
commit | c4e05116a2c4d8187127dbf77ab790aa57a47388 (patch) | |
tree | 58f07aed47ee4d30e9588d5a820c245faa163b09 /lib/rwsem.c | |
parent | 8b3db9c542e18b71d4820da4dd9401ee030feacb (diff) |
[PATCH] lockdep: clean up rwsems
Clean up rwsems.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'lib/rwsem.c')
-rw-r--r-- | lib/rwsem.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/lib/rwsem.c b/lib/rwsem.c index 62fa4eba9ffe..bae597284889 100644 --- a/lib/rwsem.c +++ b/lib/rwsem.c | |||
@@ -16,17 +16,6 @@ struct rwsem_waiter { | |||
16 | #define RWSEM_WAITING_FOR_WRITE 0x00000002 | 16 | #define RWSEM_WAITING_FOR_WRITE 0x00000002 |
17 | }; | 17 | }; |
18 | 18 | ||
19 | #if RWSEM_DEBUG | ||
20 | #undef rwsemtrace | ||
21 | void rwsemtrace(struct rw_semaphore *sem, const char *str) | ||
22 | { | ||
23 | printk("sem=%p\n", sem); | ||
24 | printk("(sem)=%08lx\n", sem->count); | ||
25 | if (sem->debug) | ||
26 | printk("[%d] %s({%08lx})\n", current->pid, str, sem->count); | ||
27 | } | ||
28 | #endif | ||
29 | |||
30 | /* | 19 | /* |
31 | * handle the lock release when processes blocked on it that can now run | 20 | * handle the lock release when processes blocked on it that can now run |
32 | * - if we come here from up_xxxx(), then: | 21 | * - if we come here from up_xxxx(), then: |
@@ -45,8 +34,6 @@ __rwsem_do_wake(struct rw_semaphore *sem, int downgrading) | |||
45 | struct list_head *next; | 34 | struct list_head *next; |
46 | signed long oldcount, woken, loop; | 35 | signed long oldcount, woken, loop; |
47 | 36 | ||
48 | rwsemtrace(sem, "Entering __rwsem_do_wake"); | ||
49 | |||
50 | if (downgrading) | 37 | if (downgrading) |
51 | goto dont_wake_writers; | 38 | goto dont_wake_writers; |
52 | 39 | ||
@@ -127,7 +114,6 @@ __rwsem_do_wake(struct rw_semaphore *sem, int downgrading) | |||
127 | next->prev = &sem->wait_list; | 114 | next->prev = &sem->wait_list; |
128 | 115 | ||
129 | out: | 116 | out: |
130 | rwsemtrace(sem, "Leaving __rwsem_do_wake"); | ||
131 | return sem; | 117 | return sem; |
132 | 118 | ||
133 | /* undo the change to count, but check for a transition 1->0 */ | 119 | /* undo the change to count, but check for a transition 1->0 */ |
@@ -186,13 +172,9 @@ rwsem_down_read_failed(struct rw_semaphore *sem) | |||
186 | { | 172 | { |
187 | struct rwsem_waiter waiter; | 173 | struct rwsem_waiter waiter; |
188 | 174 | ||
189 | rwsemtrace(sem, "Entering rwsem_down_read_failed"); | ||
190 | |||
191 | waiter.flags = RWSEM_WAITING_FOR_READ; | 175 | waiter.flags = RWSEM_WAITING_FOR_READ; |
192 | rwsem_down_failed_common(sem, &waiter, | 176 | rwsem_down_failed_common(sem, &waiter, |
193 | RWSEM_WAITING_BIAS - RWSEM_ACTIVE_BIAS); | 177 | RWSEM_WAITING_BIAS - RWSEM_ACTIVE_BIAS); |
194 | |||
195 | rwsemtrace(sem, "Leaving rwsem_down_read_failed"); | ||
196 | return sem; | 178 | return sem; |
197 | } | 179 | } |
198 | 180 | ||
@@ -204,12 +186,9 @@ rwsem_down_write_failed(struct rw_semaphore *sem) | |||
204 | { | 186 | { |
205 | struct rwsem_waiter waiter; | 187 | struct rwsem_waiter waiter; |
206 | 188 | ||
207 | rwsemtrace(sem, "Entering rwsem_down_write_failed"); | ||
208 | |||
209 | waiter.flags = RWSEM_WAITING_FOR_WRITE; | 189 | waiter.flags = RWSEM_WAITING_FOR_WRITE; |
210 | rwsem_down_failed_common(sem, &waiter, -RWSEM_ACTIVE_BIAS); | 190 | rwsem_down_failed_common(sem, &waiter, -RWSEM_ACTIVE_BIAS); |
211 | 191 | ||
212 | rwsemtrace(sem, "Leaving rwsem_down_write_failed"); | ||
213 | return sem; | 192 | return sem; |
214 | } | 193 | } |
215 | 194 | ||
@@ -221,8 +200,6 @@ struct rw_semaphore fastcall *rwsem_wake(struct rw_semaphore *sem) | |||
221 | { | 200 | { |
222 | unsigned long flags; | 201 | unsigned long flags; |
223 | 202 | ||
224 | rwsemtrace(sem, "Entering rwsem_wake"); | ||
225 | |||
226 | spin_lock_irqsave(&sem->wait_lock, flags); | 203 | spin_lock_irqsave(&sem->wait_lock, flags); |
227 | 204 | ||
228 | /* do nothing if list empty */ | 205 | /* do nothing if list empty */ |
@@ -231,8 +208,6 @@ struct rw_semaphore fastcall *rwsem_wake(struct rw_semaphore *sem) | |||
231 | 208 | ||
232 | spin_unlock_irqrestore(&sem->wait_lock, flags); | 209 | spin_unlock_irqrestore(&sem->wait_lock, flags); |
233 | 210 | ||
234 | rwsemtrace(sem, "Leaving rwsem_wake"); | ||
235 | |||
236 | return sem; | 211 | return sem; |
237 | } | 212 | } |
238 | 213 | ||
@@ -245,8 +220,6 @@ struct rw_semaphore fastcall *rwsem_downgrade_wake(struct rw_semaphore *sem) | |||
245 | { | 220 | { |
246 | unsigned long flags; | 221 | unsigned long flags; |
247 | 222 | ||
248 | rwsemtrace(sem, "Entering rwsem_downgrade_wake"); | ||
249 | |||
250 | spin_lock_irqsave(&sem->wait_lock, flags); | 223 | spin_lock_irqsave(&sem->wait_lock, flags); |
251 | 224 | ||
252 | /* do nothing if list empty */ | 225 | /* do nothing if list empty */ |
@@ -255,7 +228,6 @@ struct rw_semaphore fastcall *rwsem_downgrade_wake(struct rw_semaphore *sem) | |||
255 | 228 | ||
256 | spin_unlock_irqrestore(&sem->wait_lock, flags); | 229 | spin_unlock_irqrestore(&sem->wait_lock, flags); |
257 | 230 | ||
258 | rwsemtrace(sem, "Leaving rwsem_downgrade_wake"); | ||
259 | return sem; | 231 | return sem; |
260 | } | 232 | } |
261 | 233 | ||
@@ -263,6 +235,3 @@ EXPORT_SYMBOL(rwsem_down_read_failed); | |||
263 | EXPORT_SYMBOL(rwsem_down_write_failed); | 235 | EXPORT_SYMBOL(rwsem_down_write_failed); |
264 | EXPORT_SYMBOL(rwsem_wake); | 236 | EXPORT_SYMBOL(rwsem_wake); |
265 | EXPORT_SYMBOL(rwsem_downgrade_wake); | 237 | EXPORT_SYMBOL(rwsem_downgrade_wake); |
266 | #if RWSEM_DEBUG | ||
267 | EXPORT_SYMBOL(rwsemtrace); | ||
268 | #endif | ||