summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2017-06-20 06:06:13 -0400
committerIngo Molnar <mingo@kernel.org>2017-06-20 06:18:27 -0400
commitac6424b981bce1c4bc55675c6ce11bfe1bbfa64f (patch)
treea9312337219777a9d3fb65d4673bbc6b5eeacd9c /include
parent9705596d08ac87c18aee32cc97f2783b7d14624e (diff)
sched/wait: Rename wait_queue_t => wait_queue_entry_t
Rename: wait_queue_t => wait_queue_entry_t 'wait_queue_t' was always a slight misnomer: its name implies that it's a "queue", but in reality it's a queue *entry*. The 'real' queue is the wait queue head, which had to carry the name. Start sorting this out by renaming it to 'wait_queue_entry_t'. This also allows the real structure name 'struct __wait_queue' to lose its double underscore and become 'struct wait_queue_entry', which is the more canonical nomenclature for such data types. Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/blk-mq.h2
-rw-r--r--include/linux/eventfd.h4
-rw-r--r--include/linux/kvm_irqfd.h2
-rw-r--r--include/linux/pagemap.h2
-rw-r--r--include/linux/poll.h2
-rw-r--r--include/linux/vfio.h2
-rw-r--r--include/linux/wait.h67
-rw-r--r--include/net/af_unix.h2
-rw-r--r--include/uapi/linux/auto_fs.h4
-rw-r--r--include/uapi/linux/auto_fs4.h4
10 files changed, 47 insertions, 44 deletions
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index fcd641032f8d..95ba83806c5d 100644
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -33,7 +33,7 @@ struct blk_mq_hw_ctx {
33 struct blk_mq_ctx **ctxs; 33 struct blk_mq_ctx **ctxs;
34 unsigned int nr_ctx; 34 unsigned int nr_ctx;
35 35
36 wait_queue_t dispatch_wait; 36 wait_queue_entry_t dispatch_wait;
37 atomic_t wait_index; 37 atomic_t wait_index;
38 38
39 struct blk_mq_tags *tags; 39 struct blk_mq_tags *tags;
diff --git a/include/linux/eventfd.h b/include/linux/eventfd.h
index ff0b981f078e..9e4befd95bc7 100644
--- a/include/linux/eventfd.h
+++ b/include/linux/eventfd.h
@@ -37,7 +37,7 @@ struct eventfd_ctx *eventfd_ctx_fdget(int fd);
37struct eventfd_ctx *eventfd_ctx_fileget(struct file *file); 37struct eventfd_ctx *eventfd_ctx_fileget(struct file *file);
38__u64 eventfd_signal(struct eventfd_ctx *ctx, __u64 n); 38__u64 eventfd_signal(struct eventfd_ctx *ctx, __u64 n);
39ssize_t eventfd_ctx_read(struct eventfd_ctx *ctx, int no_wait, __u64 *cnt); 39ssize_t eventfd_ctx_read(struct eventfd_ctx *ctx, int no_wait, __u64 *cnt);
40int eventfd_ctx_remove_wait_queue(struct eventfd_ctx *ctx, wait_queue_t *wait, 40int eventfd_ctx_remove_wait_queue(struct eventfd_ctx *ctx, wait_queue_entry_t *wait,
41 __u64 *cnt); 41 __u64 *cnt);
42 42
43#else /* CONFIG_EVENTFD */ 43#else /* CONFIG_EVENTFD */
@@ -73,7 +73,7 @@ static inline ssize_t eventfd_ctx_read(struct eventfd_ctx *ctx, int no_wait,
73} 73}
74 74
75static inline int eventfd_ctx_remove_wait_queue(struct eventfd_ctx *ctx, 75static inline int eventfd_ctx_remove_wait_queue(struct eventfd_ctx *ctx,
76 wait_queue_t *wait, __u64 *cnt) 76 wait_queue_entry_t *wait, __u64 *cnt)
77{ 77{
78 return -ENOSYS; 78 return -ENOSYS;
79} 79}
diff --git a/include/linux/kvm_irqfd.h b/include/linux/kvm_irqfd.h
index 0c1de05098c8..76c2fbc59f35 100644
--- a/include/linux/kvm_irqfd.h
+++ b/include/linux/kvm_irqfd.h
@@ -46,7 +46,7 @@ struct kvm_kernel_irqfd_resampler {
46struct kvm_kernel_irqfd { 46struct kvm_kernel_irqfd {
47 /* Used for MSI fast-path */ 47 /* Used for MSI fast-path */
48 struct kvm *kvm; 48 struct kvm *kvm;
49 wait_queue_t wait; 49 wait_queue_entry_t wait;
50 /* Update side is protected by irqfds.lock */ 50 /* Update side is protected by irqfds.lock */
51 struct kvm_kernel_irq_routing_entry irq_entry; 51 struct kvm_kernel_irq_routing_entry irq_entry;
52 seqcount_t irq_entry_sc; 52 seqcount_t irq_entry_sc;
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 316a19f6b635..e7bbd9d4dc6c 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -524,7 +524,7 @@ void page_endio(struct page *page, bool is_write, int err);
524/* 524/*
525 * Add an arbitrary waiter to a page's wait queue 525 * Add an arbitrary waiter to a page's wait queue
526 */ 526 */
527extern void add_page_wait_queue(struct page *page, wait_queue_t *waiter); 527extern void add_page_wait_queue(struct page *page, wait_queue_entry_t *waiter);
528 528
529/* 529/*
530 * Fault everything in given userspace address range in. 530 * Fault everything in given userspace address range in.
diff --git a/include/linux/poll.h b/include/linux/poll.h
index 75ffc5729e4c..2889f09a1c60 100644
--- a/include/linux/poll.h
+++ b/include/linux/poll.h
@@ -75,7 +75,7 @@ static inline void init_poll_funcptr(poll_table *pt, poll_queue_proc qproc)
75struct poll_table_entry { 75struct poll_table_entry {
76 struct file *filp; 76 struct file *filp;
77 unsigned long key; 77 unsigned long key;
78 wait_queue_t wait; 78 wait_queue_entry_t wait;
79 wait_queue_head_t *wait_address; 79 wait_queue_head_t *wait_address;
80}; 80};
81 81
diff --git a/include/linux/vfio.h b/include/linux/vfio.h
index edf9b2cad277..f57076b958b7 100644
--- a/include/linux/vfio.h
+++ b/include/linux/vfio.h
@@ -183,7 +183,7 @@ struct virqfd {
183 void (*thread)(void *, void *); 183 void (*thread)(void *, void *);
184 void *data; 184 void *data;
185 struct work_struct inject; 185 struct work_struct inject;
186 wait_queue_t wait; 186 wait_queue_entry_t wait;
187 poll_table pt; 187 poll_table pt;
188 struct work_struct shutdown; 188 struct work_struct shutdown;
189 struct virqfd **pvirqfd; 189 struct virqfd **pvirqfd;
diff --git a/include/linux/wait.h b/include/linux/wait.h
index db076ca7f11d..5889f0c86ff7 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -10,15 +10,18 @@
10#include <asm/current.h> 10#include <asm/current.h>
11#include <uapi/linux/wait.h> 11#include <uapi/linux/wait.h>
12 12
13typedef struct __wait_queue wait_queue_t; 13typedef struct wait_queue_entry wait_queue_entry_t;
14typedef int (*wait_queue_func_t)(wait_queue_t *wait, unsigned mode, int flags, void *key); 14typedef int (*wait_queue_func_t)(wait_queue_entry_t *wait, unsigned mode, int flags, void *key);
15int default_wake_function(wait_queue_t *wait, unsigned mode, int flags, void *key); 15int default_wake_function(wait_queue_entry_t *wait, unsigned mode, int flags, void *key);
16 16
17/* __wait_queue::flags */ 17/* wait_queue_entry::flags */
18#define WQ_FLAG_EXCLUSIVE 0x01 18#define WQ_FLAG_EXCLUSIVE 0x01
19#define WQ_FLAG_WOKEN 0x02 19#define WQ_FLAG_WOKEN 0x02
20 20
21struct __wait_queue { 21/*
22 * A single wait-queue entry structure:
23 */
24struct wait_queue_entry {
22 unsigned int flags; 25 unsigned int flags;
23 void *private; 26 void *private;
24 wait_queue_func_t func; 27 wait_queue_func_t func;
@@ -34,7 +37,7 @@ struct wait_bit_key {
34 37
35struct wait_bit_queue { 38struct wait_bit_queue {
36 struct wait_bit_key key; 39 struct wait_bit_key key;
37 wait_queue_t wait; 40 wait_queue_entry_t wait;
38}; 41};
39 42
40struct __wait_queue_head { 43struct __wait_queue_head {
@@ -55,7 +58,7 @@ struct task_struct;
55 .task_list = { NULL, NULL } } 58 .task_list = { NULL, NULL } }
56 59
57#define DECLARE_WAITQUEUE(name, tsk) \ 60#define DECLARE_WAITQUEUE(name, tsk) \
58 wait_queue_t name = __WAITQUEUE_INITIALIZER(name, tsk) 61 wait_queue_entry_t name = __WAITQUEUE_INITIALIZER(name, tsk)
59 62
60#define __WAIT_QUEUE_HEAD_INITIALIZER(name) { \ 63#define __WAIT_QUEUE_HEAD_INITIALIZER(name) { \
61 .lock = __SPIN_LOCK_UNLOCKED(name.lock), \ 64 .lock = __SPIN_LOCK_UNLOCKED(name.lock), \
@@ -88,7 +91,7 @@ extern void __init_waitqueue_head(wait_queue_head_t *q, const char *name, struct
88# define DECLARE_WAIT_QUEUE_HEAD_ONSTACK(name) DECLARE_WAIT_QUEUE_HEAD(name) 91# define DECLARE_WAIT_QUEUE_HEAD_ONSTACK(name) DECLARE_WAIT_QUEUE_HEAD(name)
89#endif 92#endif
90 93
91static inline void init_waitqueue_entry(wait_queue_t *q, struct task_struct *p) 94static inline void init_waitqueue_entry(wait_queue_entry_t *q, struct task_struct *p)
92{ 95{
93 q->flags = 0; 96 q->flags = 0;
94 q->private = p; 97 q->private = p;
@@ -96,7 +99,7 @@ static inline void init_waitqueue_entry(wait_queue_t *q, struct task_struct *p)
96} 99}
97 100
98static inline void 101static inline void
99init_waitqueue_func_entry(wait_queue_t *q, wait_queue_func_t func) 102init_waitqueue_func_entry(wait_queue_entry_t *q, wait_queue_func_t func)
100{ 103{
101 q->flags = 0; 104 q->flags = 0;
102 q->private = NULL; 105 q->private = NULL;
@@ -159,11 +162,11 @@ static inline bool wq_has_sleeper(wait_queue_head_t *wq)
159 return waitqueue_active(wq); 162 return waitqueue_active(wq);
160} 163}
161 164
162extern void add_wait_queue(wait_queue_head_t *q, wait_queue_t *wait); 165extern void add_wait_queue(wait_queue_head_t *q, wait_queue_entry_t *wait);
163extern void add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t *wait); 166extern void add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_entry_t *wait);
164extern void remove_wait_queue(wait_queue_head_t *q, wait_queue_t *wait); 167extern void remove_wait_queue(wait_queue_head_t *q, wait_queue_entry_t *wait);
165 168
166static inline void __add_wait_queue(wait_queue_head_t *head, wait_queue_t *new) 169static inline void __add_wait_queue(wait_queue_head_t *head, wait_queue_entry_t *new)
167{ 170{
168 list_add(&new->task_list, &head->task_list); 171 list_add(&new->task_list, &head->task_list);
169} 172}
@@ -172,27 +175,27 @@ static inline void __add_wait_queue(wait_queue_head_t *head, wait_queue_t *new)
172 * Used for wake-one threads: 175 * Used for wake-one threads:
173 */ 176 */
174static inline void 177static inline void
175__add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t *wait) 178__add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_entry_t *wait)
176{ 179{
177 wait->flags |= WQ_FLAG_EXCLUSIVE; 180 wait->flags |= WQ_FLAG_EXCLUSIVE;
178 __add_wait_queue(q, wait); 181 __add_wait_queue(q, wait);
179} 182}
180 183
181static inline void __add_wait_queue_tail(wait_queue_head_t *head, 184static inline void __add_wait_queue_entry_tail(wait_queue_head_t *head,
182 wait_queue_t *new) 185 wait_queue_entry_t *new)
183{ 186{
184 list_add_tail(&new->task_list, &head->task_list); 187 list_add_tail(&new->task_list, &head->task_list);
185} 188}
186 189
187static inline void 190static inline void
188__add_wait_queue_tail_exclusive(wait_queue_head_t *q, wait_queue_t *wait) 191__add_wait_queue_entry_tail_exclusive(wait_queue_head_t *q, wait_queue_entry_t *wait)
189{ 192{
190 wait->flags |= WQ_FLAG_EXCLUSIVE; 193 wait->flags |= WQ_FLAG_EXCLUSIVE;
191 __add_wait_queue_tail(q, wait); 194 __add_wait_queue_entry_tail(q, wait);
192} 195}
193 196
194static inline void 197static inline void
195__remove_wait_queue(wait_queue_head_t *head, wait_queue_t *old) 198__remove_wait_queue(wait_queue_head_t *head, wait_queue_entry_t *old)
196{ 199{
197 list_del(&old->task_list); 200 list_del(&old->task_list);
198} 201}
@@ -249,7 +252,7 @@ wait_queue_head_t *bit_waitqueue(void *, int);
249 (!__builtin_constant_p(state) || \ 252 (!__builtin_constant_p(state) || \
250 state == TASK_INTERRUPTIBLE || state == TASK_KILLABLE) \ 253 state == TASK_INTERRUPTIBLE || state == TASK_KILLABLE) \
251 254
252extern void init_wait_entry(wait_queue_t *__wait, int flags); 255extern void init_wait_entry(wait_queue_entry_t *__wait, int flags);
253 256
254/* 257/*
255 * The below macro ___wait_event() has an explicit shadow of the __ret 258 * The below macro ___wait_event() has an explicit shadow of the __ret
@@ -266,7 +269,7 @@ extern void init_wait_entry(wait_queue_t *__wait, int flags);
266#define ___wait_event(wq, condition, state, exclusive, ret, cmd) \ 269#define ___wait_event(wq, condition, state, exclusive, ret, cmd) \
267({ \ 270({ \
268 __label__ __out; \ 271 __label__ __out; \
269 wait_queue_t __wait; \ 272 wait_queue_entry_t __wait; \
270 long __ret = ret; /* explicit shadow */ \ 273 long __ret = ret; /* explicit shadow */ \
271 \ 274 \
272 init_wait_entry(&__wait, exclusive ? WQ_FLAG_EXCLUSIVE : 0); \ 275 init_wait_entry(&__wait, exclusive ? WQ_FLAG_EXCLUSIVE : 0); \
@@ -620,8 +623,8 @@ do { \
620 __ret; \ 623 __ret; \
621}) 624})
622 625
623extern int do_wait_intr(wait_queue_head_t *, wait_queue_t *); 626extern int do_wait_intr(wait_queue_head_t *, wait_queue_entry_t *);
624extern int do_wait_intr_irq(wait_queue_head_t *, wait_queue_t *); 627extern int do_wait_intr_irq(wait_queue_head_t *, wait_queue_entry_t *);
625 628
626#define __wait_event_interruptible_locked(wq, condition, exclusive, fn) \ 629#define __wait_event_interruptible_locked(wq, condition, exclusive, fn) \
627({ \ 630({ \
@@ -967,17 +970,17 @@ do { \
967/* 970/*
968 * Waitqueues which are removed from the waitqueue_head at wakeup time 971 * Waitqueues which are removed from the waitqueue_head at wakeup time
969 */ 972 */
970void prepare_to_wait(wait_queue_head_t *q, wait_queue_t *wait, int state); 973void prepare_to_wait(wait_queue_head_t *q, wait_queue_entry_t *wait, int state);
971void prepare_to_wait_exclusive(wait_queue_head_t *q, wait_queue_t *wait, int state); 974void prepare_to_wait_exclusive(wait_queue_head_t *q, wait_queue_entry_t *wait, int state);
972long prepare_to_wait_event(wait_queue_head_t *q, wait_queue_t *wait, int state); 975long prepare_to_wait_event(wait_queue_head_t *q, wait_queue_entry_t *wait, int state);
973void finish_wait(wait_queue_head_t *q, wait_queue_t *wait); 976void finish_wait(wait_queue_head_t *q, wait_queue_entry_t *wait);
974long wait_woken(wait_queue_t *wait, unsigned mode, long timeout); 977long wait_woken(wait_queue_entry_t *wait, unsigned mode, long timeout);
975int woken_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key); 978int woken_wake_function(wait_queue_entry_t *wait, unsigned mode, int sync, void *key);
976int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key); 979int autoremove_wake_function(wait_queue_entry_t *wait, unsigned mode, int sync, void *key);
977int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key); 980int wake_bit_function(wait_queue_entry_t *wait, unsigned mode, int sync, void *key);
978 981
979#define DEFINE_WAIT_FUNC(name, function) \ 982#define DEFINE_WAIT_FUNC(name, function) \
980 wait_queue_t name = { \ 983 wait_queue_entry_t name = { \
981 .private = current, \ 984 .private = current, \
982 .func = function, \ 985 .func = function, \
983 .task_list = LIST_HEAD_INIT((name).task_list), \ 986 .task_list = LIST_HEAD_INIT((name).task_list), \
diff --git a/include/net/af_unix.h b/include/net/af_unix.h
index fd60eccb59a6..75e612a45824 100644
--- a/include/net/af_unix.h
+++ b/include/net/af_unix.h
@@ -62,7 +62,7 @@ struct unix_sock {
62#define UNIX_GC_CANDIDATE 0 62#define UNIX_GC_CANDIDATE 0
63#define UNIX_GC_MAYBE_CYCLE 1 63#define UNIX_GC_MAYBE_CYCLE 1
64 struct socket_wq peer_wq; 64 struct socket_wq peer_wq;
65 wait_queue_t peer_wake; 65 wait_queue_entry_t peer_wake;
66}; 66};
67 67
68static inline struct unix_sock *unix_sk(const struct sock *sk) 68static inline struct unix_sock *unix_sk(const struct sock *sk)
diff --git a/include/uapi/linux/auto_fs.h b/include/uapi/linux/auto_fs.h
index aa63451ef20a..1953f8d6063b 100644
--- a/include/uapi/linux/auto_fs.h
+++ b/include/uapi/linux/auto_fs.h
@@ -26,7 +26,7 @@
26#define AUTOFS_MIN_PROTO_VERSION AUTOFS_PROTO_VERSION 26#define AUTOFS_MIN_PROTO_VERSION AUTOFS_PROTO_VERSION
27 27
28/* 28/*
29 * The wait_queue_token (autofs_wqt_t) is part of a structure which is passed 29 * The wait_queue_entry_token (autofs_wqt_t) is part of a structure which is passed
30 * back to the kernel via ioctl from userspace. On architectures where 32- and 30 * back to the kernel via ioctl from userspace. On architectures where 32- and
31 * 64-bit userspace binaries can be executed it's important that the size of 31 * 64-bit userspace binaries can be executed it's important that the size of
32 * autofs_wqt_t stays constant between 32- and 64-bit Linux kernels so that we 32 * autofs_wqt_t stays constant between 32- and 64-bit Linux kernels so that we
@@ -49,7 +49,7 @@ struct autofs_packet_hdr {
49 49
50struct autofs_packet_missing { 50struct autofs_packet_missing {
51 struct autofs_packet_hdr hdr; 51 struct autofs_packet_hdr hdr;
52 autofs_wqt_t wait_queue_token; 52 autofs_wqt_t wait_queue_entry_token;
53 int len; 53 int len;
54 char name[NAME_MAX+1]; 54 char name[NAME_MAX+1];
55}; 55};
diff --git a/include/uapi/linux/auto_fs4.h b/include/uapi/linux/auto_fs4.h
index 7c6da423d54e..65b72d0222e7 100644
--- a/include/uapi/linux/auto_fs4.h
+++ b/include/uapi/linux/auto_fs4.h
@@ -108,7 +108,7 @@ enum autofs_notify {
108/* v4 multi expire (via pipe) */ 108/* v4 multi expire (via pipe) */
109struct autofs_packet_expire_multi { 109struct autofs_packet_expire_multi {
110 struct autofs_packet_hdr hdr; 110 struct autofs_packet_hdr hdr;
111 autofs_wqt_t wait_queue_token; 111 autofs_wqt_t wait_queue_entry_token;
112 int len; 112 int len;
113 char name[NAME_MAX+1]; 113 char name[NAME_MAX+1];
114}; 114};
@@ -123,7 +123,7 @@ union autofs_packet_union {
123/* autofs v5 common packet struct */ 123/* autofs v5 common packet struct */
124struct autofs_v5_packet { 124struct autofs_v5_packet {
125 struct autofs_packet_hdr hdr; 125 struct autofs_packet_hdr hdr;
126 autofs_wqt_t wait_queue_token; 126 autofs_wqt_t wait_queue_entry_token;
127 __u32 dev; 127 __u32 dev;
128 __u64 ino; 128 __u64 ino;
129 __u32 uid; 129 __u32 uid;