__mutex_add_waiter(lock, waiter, p);
}
+static inline struct task_struct *
+__ww_mutex_owner(struct mutex *lock)
+{
+ return __mutex_owner(lock);
+}
+
+static inline bool
+__ww_mutex_has_waiters(struct mutex *lock)
+{
+ return atomic_long_read(&lock->owner) & MUTEX_FLAG_WAITERS;
+}
+
/*
* Wait-Die:
* The newer transactions are killed when:
struct ww_acquire_ctx *ww_ctx,
struct ww_acquire_ctx *hold_ctx)
{
- struct task_struct *owner = __mutex_owner(lock);
+ struct task_struct *owner = __ww_mutex_owner(lock);
lockdep_assert_held(&lock->wait_lock);
* __ww_mutex_add_waiter() and makes sure we either observe ww->ctx
* and/or !empty list.
*/
- if (likely(!(atomic_long_read(&lock->base.owner) & MUTEX_FLAG_WAITERS)))
+ if (likely(!__ww_mutex_has_waiters(&lock->base)))
return;
/*