diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2009-08-23 05:49:34 -0400 |
|---|---|---|
| committer | Thomas Gleixner <tglx@linutronix.de> | 2009-08-23 05:49:34 -0400 |
| commit | dcd880ed997a25809731ef3e36488a1da3bf4edb (patch) | |
| tree | 283cd0c4170f2d7e6ff1ba34fc12d9b8e7944d0c | |
| parent | 2763510cae0996961d18171ede97279801b55d7e (diff) | |
rt: Remove rwlocks BUG_ON and useless read_depth check
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
| -rw-r--r-- | kernel/rt.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/kernel/rt.c b/kernel/rt.c index 59ca169229ac..7da32994e88f 100644 --- a/kernel/rt.c +++ b/kernel/rt.c | |||
| @@ -206,7 +206,7 @@ int __lockfunc rt_read_trylock(rwlock_t *rwlock) | |||
| 206 | /* | 206 | /* |
| 207 | * recursive read locks succeed when current owns the lock | 207 | * recursive read locks succeed when current owns the lock |
| 208 | */ | 208 | */ |
| 209 | if (rt_mutex_real_owner(lock) != current || !rwlock->read_depth) | 209 | if (rt_mutex_real_owner(lock) != current) |
| 210 | ret = rt_mutex_trylock(lock); | 210 | ret = rt_mutex_trylock(lock); |
| 211 | 211 | ||
| 212 | if (ret) { | 212 | if (ret) { |
| @@ -234,7 +234,7 @@ void __lockfunc rt_read_lock(rwlock_t *rwlock) | |||
| 234 | /* | 234 | /* |
| 235 | * recursive read locks succeed when current owns the lock | 235 | * recursive read locks succeed when current owns the lock |
| 236 | */ | 236 | */ |
| 237 | if (rt_mutex_real_owner(lock) != current || !rwlock->read_depth) | 237 | if (rt_mutex_real_owner(lock) != current) |
| 238 | __rt_spin_lock(lock); | 238 | __rt_spin_lock(lock); |
| 239 | rwlock->read_depth++; | 239 | rwlock->read_depth++; |
| 240 | } | 240 | } |
| @@ -253,8 +253,6 @@ void __lockfunc rt_read_unlock(rwlock_t *rwlock) | |||
| 253 | { | 253 | { |
| 254 | rwlock_release(&rwlock->dep_map, 1, _RET_IP_); | 254 | rwlock_release(&rwlock->dep_map, 1, _RET_IP_); |
| 255 | 255 | ||
| 256 | BUG_ON(rwlock->read_depth <= 0); | ||
| 257 | |||
| 258 | /* Release the lock only when read_depth is down to 0 */ | 256 | /* Release the lock only when read_depth is down to 0 */ |
| 259 | if (--rwlock->read_depth == 0) | 257 | if (--rwlock->read_depth == 0) |
| 260 | __rt_spin_unlock(&rwlock->lock); | 258 | __rt_spin_unlock(&rwlock->lock); |
