mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 16:41:25 +00:00
locking/rtmutex: Decrapify __rt_mutex_init()
The conditional debug handling is just another layer of obfuscation. Split the function so rt_mutex_init_proxy_locked() can invoke the inner init and __rt_mutex_init() gets the full treatment. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@kernel.org> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/r/20210326153943.955697588@linutronix.de
This commit is contained in:
parent
37350e3b26
commit
f5a98866e5
2 changed files with 11 additions and 6 deletions
|
@ -1586,12 +1586,10 @@ void __sched rt_mutex_futex_unlock(struct rt_mutex *lock)
|
||||||
void __rt_mutex_init(struct rt_mutex *lock, const char *name,
|
void __rt_mutex_init(struct rt_mutex *lock, const char *name,
|
||||||
struct lock_class_key *key)
|
struct lock_class_key *key)
|
||||||
{
|
{
|
||||||
lock->owner = NULL;
|
debug_check_no_locks_freed((void *)lock, sizeof(*lock));
|
||||||
raw_spin_lock_init(&lock->wait_lock);
|
lockdep_init_map(&lock->dep_map, name, key, 0);
|
||||||
lock->waiters = RB_ROOT_CACHED;
|
|
||||||
|
|
||||||
if (name && key)
|
__rt_mutex_basic_init(lock);
|
||||||
debug_rt_mutex_init(lock, name, key);
|
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(__rt_mutex_init);
|
EXPORT_SYMBOL_GPL(__rt_mutex_init);
|
||||||
|
|
||||||
|
@ -1612,7 +1610,7 @@ EXPORT_SYMBOL_GPL(__rt_mutex_init);
|
||||||
void rt_mutex_init_proxy_locked(struct rt_mutex *lock,
|
void rt_mutex_init_proxy_locked(struct rt_mutex *lock,
|
||||||
struct task_struct *proxy_owner)
|
struct task_struct *proxy_owner)
|
||||||
{
|
{
|
||||||
__rt_mutex_init(lock, NULL, NULL);
|
__rt_mutex_basic_init(lock);
|
||||||
rt_mutex_set_owner(lock, proxy_owner);
|
rt_mutex_set_owner(lock, proxy_owner);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -100,6 +100,13 @@ enum rtmutex_chainwalk {
|
||||||
RT_MUTEX_FULL_CHAINWALK,
|
RT_MUTEX_FULL_CHAINWALK,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static inline void __rt_mutex_basic_init(struct rt_mutex *lock)
|
||||||
|
{
|
||||||
|
lock->owner = NULL;
|
||||||
|
raw_spin_lock_init(&lock->wait_lock);
|
||||||
|
lock->waiters = RB_ROOT_CACHED;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* PI-futex support (proxy locking functions, etc.):
|
* PI-futex support (proxy locking functions, etc.):
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue