diff options
Diffstat (limited to 'kernel/locking/rtmutex.c')
-rw-r--r-- | kernel/locking/rtmutex.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c index 4f014be7a4b8..2823d4163a37 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c | |||
@@ -1465,6 +1465,29 @@ rt_mutex_fastunlock(struct rt_mutex *lock, | |||
1465 | rt_mutex_postunlock(&wake_q); | 1465 | rt_mutex_postunlock(&wake_q); |
1466 | } | 1466 | } |
1467 | 1467 | ||
1468 | static inline void __rt_mutex_lock(struct rt_mutex *lock, unsigned int subclass) | ||
1469 | { | ||
1470 | might_sleep(); | ||
1471 | |||
1472 | mutex_acquire(&lock->dep_map, subclass, 0, _RET_IP_); | ||
1473 | rt_mutex_fastlock(lock, TASK_UNINTERRUPTIBLE, rt_mutex_slowlock); | ||
1474 | } | ||
1475 | |||
1476 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
1477 | /** | ||
1478 | * rt_mutex_lock_nested - lock a rt_mutex | ||
1479 | * | ||
1480 | * @lock: the rt_mutex to be locked | ||
1481 | * @subclass: the lockdep subclass | ||
1482 | */ | ||
1483 | void __sched rt_mutex_lock_nested(struct rt_mutex *lock, unsigned int subclass) | ||
1484 | { | ||
1485 | __rt_mutex_lock(lock, subclass); | ||
1486 | } | ||
1487 | EXPORT_SYMBOL_GPL(rt_mutex_lock_nested); | ||
1488 | #endif | ||
1489 | |||
1490 | #ifndef CONFIG_DEBUG_LOCK_ALLOC | ||
1468 | /** | 1491 | /** |
1469 | * rt_mutex_lock - lock a rt_mutex | 1492 | * rt_mutex_lock - lock a rt_mutex |
1470 | * | 1493 | * |
@@ -1472,12 +1495,10 @@ rt_mutex_fastunlock(struct rt_mutex *lock, | |||
1472 | */ | 1495 | */ |
1473 | void __sched rt_mutex_lock(struct rt_mutex *lock) | 1496 | void __sched rt_mutex_lock(struct rt_mutex *lock) |
1474 | { | 1497 | { |
1475 | might_sleep(); | 1498 | __rt_mutex_lock(lock, 0); |
1476 | |||
1477 | mutex_acquire(&lock->dep_map, 0, 0, _RET_IP_); | ||
1478 | rt_mutex_fastlock(lock, TASK_UNINTERRUPTIBLE, rt_mutex_slowlock); | ||
1479 | } | 1499 | } |
1480 | EXPORT_SYMBOL_GPL(rt_mutex_lock); | 1500 | EXPORT_SYMBOL_GPL(rt_mutex_lock); |
1501 | #endif | ||
1481 | 1502 | ||
1482 | /** | 1503 | /** |
1483 | * rt_mutex_lock_interruptible - lock a rt_mutex interruptible | 1504 | * rt_mutex_lock_interruptible - lock a rt_mutex interruptible |