locking: Move MCS struct definition to public header
authorKumar Kartikeya Dwivedi <memxor@gmail.com>
Sun, 16 Mar 2025 04:05:17 +0000 (21:05 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 18 Mar 2025 17:28:21 +0000 (10:28 -0700)
Move the definition of the struct mcs_spinlock from the private
mcs_spinlock.h header in kernel/locking to the mcs_spinlock.h
asm-generic header, since we will need to reference it from the
qspinlock.h header in subsequent commits.

Reviewed-by: Barret Rhoden <brho@google.com>
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/r/20250316040541.108729-2-memxor@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/asm-generic/mcs_spinlock.h
kernel/locking/mcs_spinlock.h

index 10cd4ffc6ba29563c1f5813c587db69164b23189..39c94012b88a8db58ce59a8b3f8fd5cc4dcaf5b6 100644 (file)
@@ -1,6 +1,12 @@
 #ifndef __ASM_MCS_SPINLOCK_H
 #define __ASM_MCS_SPINLOCK_H
 
+struct mcs_spinlock {
+       struct mcs_spinlock *next;
+       int locked; /* 1 if lock acquired */
+       int count;  /* nesting count, see qspinlock.c */
+};
+
 /*
  * Architectures can define their own:
  *
index 85251d8771d91904446d085cf6992da4b33c3e0c..16160ca8907fbc6e9721916cc0a09a787264a890 100644 (file)
 
 #include <asm/mcs_spinlock.h>
 
-struct mcs_spinlock {
-       struct mcs_spinlock *next;
-       int locked; /* 1 if lock acquired */
-       int count;  /* nesting count, see qspinlock.c */
-};
-
 #ifndef arch_mcs_spin_lock_contended
 /*
  * Using smp_cond_load_acquire() provides the acquire semantics