condition migration_disable on lock acquisition

No need to unconditionally migrate_disable (what is it protecting ?) and
re-enable on failure to acquire the lock.
This patch moves the migrate_disable to be conditioned on sucessful lock
acquisition only.

Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
This commit is contained in:
Nicholas Mc Guire 2013-11-21 22:52:30 -05:00 committed by Alibek Omarov
parent d5af4a6a85
commit 2028b2a96c
1 changed files with 3 additions and 4 deletions

View File

@ -182,11 +182,10 @@ int __lockfunc rt_write_trylock(rwlock_t *rwlock)
{
int ret = rt_mutex_trylock(&rwlock->lock);
migrate_disable();
if (ret)
if (ret) {
rwlock_acquire(&rwlock->dep_map, 0, 1, _RET_IP_);
else
migrate_enable();
migrate_disable();
}
return ret;
}