Skip to content

Commit 8707d1e

Browse files
kkdwivediAlexei Starovoitov
authored andcommitted
locking: Move MCS struct definition to public header
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>
1 parent ae0a457 commit 8707d1e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

include/asm-generic/mcs_spinlock.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#ifndef __ASM_MCS_SPINLOCK_H
22
#define __ASM_MCS_SPINLOCK_H
33

4+
struct mcs_spinlock {
5+
struct mcs_spinlock *next;
6+
int locked; /* 1 if lock acquired */
7+
int count; /* nesting count, see qspinlock.c */
8+
};
9+
410
/*
511
* Architectures can define their own:
612
*

kernel/locking/mcs_spinlock.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@
1515

1616
#include <asm/mcs_spinlock.h>
1717

18-
struct mcs_spinlock {
19-
struct mcs_spinlock *next;
20-
int locked; /* 1 if lock acquired */
21-
int count; /* nesting count, see qspinlock.c */
22-
};
23-
2418
#ifndef arch_mcs_spin_lock_contended
2519
/*
2620
* Using smp_cond_load_acquire() provides the acquire semantics

0 commit comments

Comments
 (0)