Skip to content

Commit 7c22309

Browse files
david-laighttorvalds
authored andcommitted
locking/osq_lock: Move the definition of optimistic_spin_node into osq_lock.c
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>
1 parent f016f75 commit 7c22309

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

include/linux/osq_lock.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
* An MCS like lock especially tailored for optimistic spinning for sleeping
77
* lock implementations (mutex, rwsem, etc).
88
*/
9-
struct optimistic_spin_node {
10-
struct optimistic_spin_node *next, *prev;
11-
int locked; /* 1 if lock acquired */
12-
int cpu; /* encoded CPU # + 1 value */
13-
};
149

1510
struct optimistic_spin_queue {
1611
/*

kernel/locking/osq_lock.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@
1111
* called from interrupt context and we have preemption disabled while
1212
* spinning.
1313
*/
14+
15+
struct optimistic_spin_node {
16+
struct optimistic_spin_node *next, *prev;
17+
int locked; /* 1 if lock acquired */
18+
int cpu; /* encoded CPU # + 1 value */
19+
};
20+
1421
static DEFINE_PER_CPU_SHARED_ALIGNED(struct optimistic_spin_node, osq_node);
1522

1623
/*

0 commit comments

Comments
 (0)