locking/osq_lock: Move the definition of optimistic_spin_node into osq_lock.c
authorDavid Laight <David.Laight@ACULAB.COM>
Fri, 29 Dec 2023 20:53:49 +0000 (20:53 +0000)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 30 Dec 2023 18:25:51 +0000 (10:25 -0800)
struct optimistic_spin_node is private to the implementation.
Move it into the C file to ensure nothing is accessing it.

Signed-off-by: David Laight <david.laight@aculab.com>
Acked-by: Waiman Long <longman@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/osq_lock.h
kernel/locking/osq_lock.c

index 5581dbd3bd3407c6009b565fb935e0797585ab3b..ea8fb31379e3cba3520c202e1d4b42fb08e13e04 100644 (file)
@@ -6,11 +6,6 @@
  * An MCS like lock especially tailored for optimistic spinning for sleeping
  * lock implementations (mutex, rwsem, etc).
  */
-struct optimistic_spin_node {
-       struct optimistic_spin_node *next, *prev;
-       int locked; /* 1 if lock acquired */
-       int cpu; /* encoded CPU # + 1 value */
-};
 
 struct optimistic_spin_queue {
        /*
index d5610ad52b92b55b98b6a35f8700c5df940e8f81..d414eef4bec60fc282166461085f7e91a09bebeb 100644 (file)
  * called from interrupt context and we have preemption disabled while
  * spinning.
  */
+
+struct optimistic_spin_node {
+       struct optimistic_spin_node *next, *prev;
+       int locked; /* 1 if lock acquired */
+       int cpu; /* encoded CPU # + 1 value */
+};
+
 static DEFINE_PER_CPU_SHARED_ALIGNED(struct optimistic_spin_node, osq_node);
 
 /*