From 0c72b6a7533fdf48e066a9fd74a36c6af0b11095 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Sun, 23 Aug 2009 11:49:34 +0200 Subject: [PATCH] rt: Remove rwlocks BUG_ON and useless read_depth check commit dcd880ed997a25809731ef3e36488a1da3bf4edb in tip. Signed-off-by: Thomas Gleixner Signed-off-by: Paul Gortmaker --- kernel/rt.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/kernel/rt.c b/kernel/rt.c index 59ca169..7da3299 100644 --- a/kernel/rt.c +++ b/kernel/rt.c @@ -206,7 +206,7 @@ int __lockfunc rt_read_trylock(rwlock_t *rwlock) /* * recursive read locks succeed when current owns the lock */ - if (rt_mutex_real_owner(lock) != current || !rwlock->read_depth) + if (rt_mutex_real_owner(lock) != current) ret = rt_mutex_trylock(lock); if (ret) { @@ -234,7 +234,7 @@ void __lockfunc rt_read_lock(rwlock_t *rwlock) /* * recursive read locks succeed when current owns the lock */ - if (rt_mutex_real_owner(lock) != current || !rwlock->read_depth) + if (rt_mutex_real_owner(lock) != current) __rt_spin_lock(lock); rwlock->read_depth++; } @@ -253,8 +253,6 @@ void __lockfunc rt_read_unlock(rwlock_t *rwlock) { rwlock_release(&rwlock->dep_map, 1, _RET_IP_); - BUG_ON(rwlock->read_depth <= 0); - /* Release the lock only when read_depth is down to 0 */ if (--rwlock->read_depth == 0) __rt_spin_unlock(&rwlock->lock); -- 1.7.0.4