Skip to content

Commit 88e77dc

Browse files
Peter ZijlstraIngo Molnar
authored andcommitted
locking/mutex: Add comment to __mutex_owner() to deter usage
Attempt to deter usage, this is not a public interface. It is entirely possible to implement a conformant mutex without having this owner field (in fact, we used to have that). Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Paul E. McKenney <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 91ab883 commit 88e77dc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

include/linux/mutex.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ struct mutex {
6666
#endif
6767
};
6868

69+
/*
70+
* Internal helper function; C doesn't allow us to hide it :/
71+
*
72+
* DO NOT USE (outside of mutex code).
73+
*/
6974
static inline struct task_struct *__mutex_owner(struct mutex *lock)
7075
{
7176
return (struct task_struct *)(atomic_long_read(&lock->owner) & ~0x07);

0 commit comments

Comments
 (0)