Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

David Laight and committed by
Linus Torvalds
7c223098 f016f754

+7 -5
-5
include/linux/osq_lock.h
··· 6 6 * An MCS like lock especially tailored for optimistic spinning for sleeping 7 7 * lock implementations (mutex, rwsem, etc). 8 8 */ 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 - }; 14 9 15 10 struct optimistic_spin_queue { 16 11 /*
+7
kernel/locking/osq_lock.c
··· 11 11 * called from interrupt context and we have preemption disabled while 12 12 * spinning. 13 13 */ 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 + 14 21 static DEFINE_PER_CPU_SHARED_ALIGNED(struct optimistic_spin_node, osq_node); 15 22 16 23 /*