Skip to content

Commit ac6424b

Browse files
author
Ingo Molnar
committed
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 <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 9705596 commit ac6424b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+216
-213
lines changed

Documentation/DocBook/kernel-hacking.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ printk(KERN_INFO "my ip: %pI4\n", &amp;ipaddress);
819819
certain condition is true. They must be used carefully to ensure
820820
there is no race condition. You declare a
821821
<type>wait_queue_head_t</type>, and then processes which want to
822-
wait for that condition declare a <type>wait_queue_t</type>
822+
wait for that condition declare a <type>wait_queue_entry_t</type>
823823
referring to themselves, and place that in the queue.
824824
</para>
825825

Documentation/filesystems/autofs4.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ For version 5, the format of the message is:
316316
struct autofs_v5_packet {
317317
int proto_version; /* Protocol version */
318318
int type; /* Type of packet */
319-
autofs_wqt_t wait_queue_token;
319+
autofs_wqt_t wait_queue_entry_token;
320320
__u32 dev;
321321
__u64 ino;
322322
__u32 uid;
@@ -341,12 +341,12 @@ The pipe will be set to "packet mode" (equivalent to passing
341341
`O_DIRECT`) to _pipe2(2)_ so that a read from the pipe will return at
342342
most one packet, and any unread portion of a packet will be discarded.
343343

344-
The `wait_queue_token` is a unique number which can identify a
344+
The `wait_queue_entry_token` is a unique number which can identify a
345345
particular request to be acknowledged. When a message is sent over
346346
the pipe the affected dentry is marked as either "active" or
347347
"expiring" and other accesses to it block until the message is
348348
acknowledged using one of the ioctls below and the relevant
349-
`wait_queue_token`.
349+
`wait_queue_entry_token`.
350350

351351
Communicating with autofs: root directory ioctls
352352
------------------------------------------------
@@ -358,7 +358,7 @@ capability, or must be the automount daemon.
358358
The available ioctl commands are:
359359

360360
- **AUTOFS_IOC_READY**: a notification has been handled. The argument
361-
to the ioctl command is the "wait_queue_token" number
361+
to the ioctl command is the "wait_queue_entry_token" number
362362
corresponding to the notification being acknowledged.
363363
- **AUTOFS_IOC_FAIL**: similar to above, but indicates failure with
364364
the error code `ENOENT`.
@@ -382,14 +382,14 @@ The available ioctl commands are:
382382
struct autofs_packet_expire_multi {
383383
int proto_version; /* Protocol version */
384384
int type; /* Type of packet */
385-
autofs_wqt_t wait_queue_token;
385+
autofs_wqt_t wait_queue_entry_token;
386386
int len;
387387
char name[NAME_MAX+1];
388388
};
389389

390390
is required. This is filled in with the name of something
391391
that can be unmounted or removed. If nothing can be expired,
392-
`errno` is set to `EAGAIN`. Even though a `wait_queue_token`
392+
`errno` is set to `EAGAIN`. Even though a `wait_queue_entry_token`
393393
is present in the structure, no "wait queue" is established
394394
and no acknowledgment is needed.
395395
- **AUTOFS_IOC_EXPIRE_MULTI**: This is similar to

block/blk-mq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ static bool reorder_tags_to_front(struct list_head *list)
926926
return first != NULL;
927927
}
928928

929-
static int blk_mq_dispatch_wake(wait_queue_t *wait, unsigned mode, int flags,
929+
static int blk_mq_dispatch_wake(wait_queue_entry_t *wait, unsigned mode, int flags,
930930
void *key)
931931
{
932932
struct blk_mq_hw_ctx *hctx;

block/blk-wbt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ static inline unsigned int get_limit(struct rq_wb *rwb, unsigned long rw)
503503
}
504504

505505
static inline bool may_queue(struct rq_wb *rwb, struct rq_wait *rqw,
506-
wait_queue_t *wait, unsigned long rw)
506+
wait_queue_entry_t *wait, unsigned long rw)
507507
{
508508
/*
509509
* inc it here even if disabled, since we'll dec it at completion.

block/kyber-iosched.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ struct kyber_hctx_data {
9999
struct list_head rqs[KYBER_NUM_DOMAINS];
100100
unsigned int cur_domain;
101101
unsigned int batching;
102-
wait_queue_t domain_wait[KYBER_NUM_DOMAINS];
102+
wait_queue_entry_t domain_wait[KYBER_NUM_DOMAINS];
103103
atomic_t wait_index[KYBER_NUM_DOMAINS];
104104
};
105105

@@ -507,7 +507,7 @@ static void kyber_flush_busy_ctxs(struct kyber_hctx_data *khd,
507507
}
508508
}
509509

510-
static int kyber_domain_wake(wait_queue_t *wait, unsigned mode, int flags,
510+
static int kyber_domain_wake(wait_queue_entry_t *wait, unsigned mode, int flags,
511511
void *key)
512512
{
513513
struct blk_mq_hw_ctx *hctx = READ_ONCE(wait->private);
@@ -523,7 +523,7 @@ static int kyber_get_domain_token(struct kyber_queue_data *kqd,
523523
{
524524
unsigned int sched_domain = khd->cur_domain;
525525
struct sbitmap_queue *domain_tokens = &kqd->domain_tokens[sched_domain];
526-
wait_queue_t *wait = &khd->domain_wait[sched_domain];
526+
wait_queue_entry_t *wait = &khd->domain_wait[sched_domain];
527527
struct sbq_wait_state *ws;
528528
int nr;
529529

@@ -734,7 +734,7 @@ static int kyber_##name##_waiting_show(void *data, struct seq_file *m) \
734734
{ \
735735
struct blk_mq_hw_ctx *hctx = data; \
736736
struct kyber_hctx_data *khd = hctx->sched_data; \
737-
wait_queue_t *wait = &khd->domain_wait[domain]; \
737+
wait_queue_entry_t *wait = &khd->domain_wait[domain]; \
738738
\
739739
seq_printf(m, "%d\n", !list_empty_careful(&wait->task_list)); \
740740
return 0; \

drivers/bluetooth/btmrvl_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ static int btmrvl_service_main_thread(void *data)
602602
struct btmrvl_thread *thread = data;
603603
struct btmrvl_private *priv = thread->priv;
604604
struct btmrvl_adapter *adapter = priv->adapter;
605-
wait_queue_t wait;
605+
wait_queue_entry_t wait;
606606
struct sk_buff *skb;
607607
ulong flags;
608608

drivers/char/ipmi/ipmi_watchdog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ static ssize_t ipmi_read(struct file *file,
821821
loff_t *ppos)
822822
{
823823
int rv = 0;
824-
wait_queue_t wait;
824+
wait_queue_entry_t wait;
825825

826826
if (count <= 0)
827827
return 0;

drivers/gpu/drm/i915/i915_gem_request.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ struct drm_i915_gem_request {
123123
* It is used by the driver to then queue the request for execution.
124124
*/
125125
struct i915_sw_fence submit;
126-
wait_queue_t submitq;
126+
wait_queue_entry_t submitq;
127127
wait_queue_head_t execute;
128128

129129
/* A list of everyone we wait upon, and everyone who waits upon us.

drivers/gpu/drm/i915/i915_sw_fence.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ static void __i915_sw_fence_wake_up_all(struct i915_sw_fence *fence,
152152
struct list_head *continuation)
153153
{
154154
wait_queue_head_t *x = &fence->wait;
155-
wait_queue_t *pos, *next;
155+
wait_queue_entry_t *pos, *next;
156156
unsigned long flags;
157157

158158
debug_fence_deactivate(fence);
@@ -254,7 +254,7 @@ void i915_sw_fence_commit(struct i915_sw_fence *fence)
254254
__i915_sw_fence_commit(fence);
255255
}
256256

257-
static int i915_sw_fence_wake(wait_queue_t *wq, unsigned mode, int flags, void *key)
257+
static int i915_sw_fence_wake(wait_queue_entry_t *wq, unsigned mode, int flags, void *key)
258258
{
259259
list_del(&wq->task_list);
260260
__i915_sw_fence_complete(wq->private, key);
@@ -267,7 +267,7 @@ static int i915_sw_fence_wake(wait_queue_t *wq, unsigned mode, int flags, void *
267267
static bool __i915_sw_fence_check_if_after(struct i915_sw_fence *fence,
268268
const struct i915_sw_fence * const signaler)
269269
{
270-
wait_queue_t *wq;
270+
wait_queue_entry_t *wq;
271271

272272
if (__test_and_set_bit(I915_SW_FENCE_CHECKED_BIT, &fence->flags))
273273
return false;
@@ -288,7 +288,7 @@ static bool __i915_sw_fence_check_if_after(struct i915_sw_fence *fence,
288288

289289
static void __i915_sw_fence_clear_checked_bit(struct i915_sw_fence *fence)
290290
{
291-
wait_queue_t *wq;
291+
wait_queue_entry_t *wq;
292292

293293
if (!__test_and_clear_bit(I915_SW_FENCE_CHECKED_BIT, &fence->flags))
294294
return;
@@ -320,7 +320,7 @@ static bool i915_sw_fence_check_if_after(struct i915_sw_fence *fence,
320320

321321
static int __i915_sw_fence_await_sw_fence(struct i915_sw_fence *fence,
322322
struct i915_sw_fence *signaler,
323-
wait_queue_t *wq, gfp_t gfp)
323+
wait_queue_entry_t *wq, gfp_t gfp)
324324
{
325325
unsigned long flags;
326326
int pending;
@@ -359,7 +359,7 @@ static int __i915_sw_fence_await_sw_fence(struct i915_sw_fence *fence,
359359

360360
spin_lock_irqsave(&signaler->wait.lock, flags);
361361
if (likely(!i915_sw_fence_done(signaler))) {
362-
__add_wait_queue_tail(&signaler->wait, wq);
362+
__add_wait_queue_entry_tail(&signaler->wait, wq);
363363
pending = 1;
364364
} else {
365365
i915_sw_fence_wake(wq, 0, 0, NULL);
@@ -372,7 +372,7 @@ static int __i915_sw_fence_await_sw_fence(struct i915_sw_fence *fence,
372372

373373
int i915_sw_fence_await_sw_fence(struct i915_sw_fence *fence,
374374
struct i915_sw_fence *signaler,
375-
wait_queue_t *wq)
375+
wait_queue_entry_t *wq)
376376
{
377377
return __i915_sw_fence_await_sw_fence(fence, signaler, wq, 0);
378378
}

drivers/gpu/drm/i915/i915_sw_fence.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ void i915_sw_fence_commit(struct i915_sw_fence *fence);
6666

6767
int i915_sw_fence_await_sw_fence(struct i915_sw_fence *fence,
6868
struct i915_sw_fence *after,
69-
wait_queue_t *wq);
69+
wait_queue_entry_t *wq);
7070
int i915_sw_fence_await_sw_fence_gfp(struct i915_sw_fence *fence,
7171
struct i915_sw_fence *after,
7272
gfp_t gfp);

drivers/gpu/drm/radeon/radeon.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ struct radeon_fence {
375375
unsigned ring;
376376
bool is_vm_update;
377377

378-
wait_queue_t fence_wake;
378+
wait_queue_entry_t fence_wake;
379379
};
380380

381381
int radeon_fence_driver_start_ring(struct radeon_device *rdev, int ring);

drivers/gpu/drm/radeon/radeon_fence.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ int radeon_fence_emit(struct radeon_device *rdev,
158158
* for the fence locking itself, so unlocked variants are used for
159159
* fence_signal, and remove_wait_queue.
160160
*/
161-
static int radeon_fence_check_signaled(wait_queue_t *wait, unsigned mode, int flags, void *key)
161+
static int radeon_fence_check_signaled(wait_queue_entry_t *wait, unsigned mode, int flags, void *key)
162162
{
163163
struct radeon_fence *fence;
164164
u64 seq;

drivers/gpu/vga/vgaarb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ int vga_get(struct pci_dev *pdev, unsigned int rsrc, int interruptible)
417417
{
418418
struct vga_device *vgadev, *conflict;
419419
unsigned long flags;
420-
wait_queue_t wait;
420+
wait_queue_entry_t wait;
421421
int rc = 0;
422422

423423
vga_check_first_use();

drivers/infiniband/hw/i40iw/i40iw_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1939,7 +1939,7 @@ static int i40iw_virtchnl_receive(struct i40e_info *ldev,
19391939
bool i40iw_vf_clear_to_send(struct i40iw_sc_dev *dev)
19401940
{
19411941
struct i40iw_device *iwdev;
1942-
wait_queue_t wait;
1942+
wait_queue_entry_t wait;
19431943

19441944
iwdev = dev->back_dev;
19451945

drivers/md/bcache/btree.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ void bkey_put(struct cache_set *c, struct bkey *k);
207207

208208
struct btree_op {
209209
/* for waiting on btree reserve in btree_split() */
210-
wait_queue_t wait;
210+
wait_queue_entry_t wait;
211211

212212
/* Btree level at which we start taking write locks */
213213
short lock;

drivers/net/ethernet/cavium/liquidio/octeon_main.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ static inline int
144144
sleep_cond(wait_queue_head_t *wait_queue, int *condition)
145145
{
146146
int errno = 0;
147-
wait_queue_t we;
147+
wait_queue_entry_t we;
148148

149149
init_waitqueue_entry(&we, current);
150150
add_wait_queue(wait_queue, &we);
@@ -171,7 +171,7 @@ sleep_timeout_cond(wait_queue_head_t *wait_queue,
171171
int *condition,
172172
int timeout)
173173
{
174-
wait_queue_t we;
174+
wait_queue_entry_t we;
175175

176176
init_waitqueue_entry(&we, current);
177177
add_wait_queue(wait_queue, &we);

drivers/net/wireless/cisco/airo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3066,7 +3066,7 @@ static int airo_thread(void *data) {
30663066
if (ai->jobs) {
30673067
locked = down_interruptible(&ai->sem);
30683068
} else {
3069-
wait_queue_t wait;
3069+
wait_queue_entry_t wait;
30703070

30713071
init_waitqueue_entry(&wait, current);
30723072
add_wait_queue(&ai->thr_wait, &wait);

drivers/net/wireless/intersil/hostap/hostap_ioctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2544,7 +2544,7 @@ static int prism2_ioctl_priv_prism2_param(struct net_device *dev,
25442544
ret = -EINVAL;
25452545
}
25462546
if (local->iw_mode == IW_MODE_MASTER) {
2547-
wait_queue_t __wait;
2547+
wait_queue_entry_t __wait;
25482548
init_waitqueue_entry(&__wait, current);
25492549
add_wait_queue(&local->hostscan_wq, &__wait);
25502550
set_current_state(TASK_INTERRUPTIBLE);

drivers/net/wireless/marvell/libertas/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ static int lbs_thread(void *data)
453453
{
454454
struct net_device *dev = data;
455455
struct lbs_private *priv = dev->ml_priv;
456-
wait_queue_t wait;
456+
wait_queue_entry_t wait;
457457

458458
lbs_deb_enter(LBS_DEB_THREAD);
459459

drivers/scsi/dpt/dpti_i2o.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
#include <linux/wait.h>
4949
typedef wait_queue_head_t adpt_wait_queue_head_t;
5050
#define ADPT_DECLARE_WAIT_QUEUE_HEAD(wait) DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wait)
51-
typedef wait_queue_t adpt_wait_queue_t;
51+
typedef wait_queue_entry_t adpt_wait_queue_entry_t;
5252

5353
/*
5454
* message structures

drivers/scsi/ips.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -301,13 +301,13 @@ static uint32_t ips_statupd_copperhead_memio(ips_ha_t *);
301301
static uint32_t ips_statupd_morpheus(ips_ha_t *);
302302
static ips_scb_t *ips_getscb(ips_ha_t *);
303303
static void ips_putq_scb_head(ips_scb_queue_t *, ips_scb_t *);
304-
static void ips_putq_wait_tail(ips_wait_queue_t *, struct scsi_cmnd *);
304+
static void ips_putq_wait_tail(ips_wait_queue_entry_t *, struct scsi_cmnd *);
305305
static void ips_putq_copp_tail(ips_copp_queue_t *,
306306
ips_copp_wait_item_t *);
307307
static ips_scb_t *ips_removeq_scb_head(ips_scb_queue_t *);
308308
static ips_scb_t *ips_removeq_scb(ips_scb_queue_t *, ips_scb_t *);
309-
static struct scsi_cmnd *ips_removeq_wait_head(ips_wait_queue_t *);
310-
static struct scsi_cmnd *ips_removeq_wait(ips_wait_queue_t *,
309+
static struct scsi_cmnd *ips_removeq_wait_head(ips_wait_queue_entry_t *);
310+
static struct scsi_cmnd *ips_removeq_wait(ips_wait_queue_entry_t *,
311311
struct scsi_cmnd *);
312312
static ips_copp_wait_item_t *ips_removeq_copp(ips_copp_queue_t *,
313313
ips_copp_wait_item_t *);
@@ -2871,7 +2871,7 @@ ips_removeq_scb(ips_scb_queue_t * queue, ips_scb_t * item)
28712871
/* ASSUMED to be called from within the HA lock */
28722872
/* */
28732873
/****************************************************************************/
2874-
static void ips_putq_wait_tail(ips_wait_queue_t *queue, struct scsi_cmnd *item)
2874+
static void ips_putq_wait_tail(ips_wait_queue_entry_t *queue, struct scsi_cmnd *item)
28752875
{
28762876
METHOD_TRACE("ips_putq_wait_tail", 1);
28772877

@@ -2902,7 +2902,7 @@ static void ips_putq_wait_tail(ips_wait_queue_t *queue, struct scsi_cmnd *item)
29022902
/* ASSUMED to be called from within the HA lock */
29032903
/* */
29042904
/****************************************************************************/
2905-
static struct scsi_cmnd *ips_removeq_wait_head(ips_wait_queue_t *queue)
2905+
static struct scsi_cmnd *ips_removeq_wait_head(ips_wait_queue_entry_t *queue)
29062906
{
29072907
struct scsi_cmnd *item;
29082908

@@ -2936,7 +2936,7 @@ static struct scsi_cmnd *ips_removeq_wait_head(ips_wait_queue_t *queue)
29362936
/* ASSUMED to be called from within the HA lock */
29372937
/* */
29382938
/****************************************************************************/
2939-
static struct scsi_cmnd *ips_removeq_wait(ips_wait_queue_t *queue,
2939+
static struct scsi_cmnd *ips_removeq_wait(ips_wait_queue_entry_t *queue,
29402940
struct scsi_cmnd *item)
29412941
{
29422942
struct scsi_cmnd *p;

drivers/scsi/ips.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,7 @@ typedef struct ips_wait_queue {
989989
struct scsi_cmnd *head;
990990
struct scsi_cmnd *tail;
991991
int count;
992-
} ips_wait_queue_t;
992+
} ips_wait_queue_entry_t;
993993

994994
typedef struct ips_copp_wait_item {
995995
struct scsi_cmnd *scsi_cmd;
@@ -1035,7 +1035,7 @@ typedef struct ips_ha {
10351035
ips_stat_t sp; /* Status packer pointer */
10361036
struct ips_scb *scbs; /* Array of all CCBS */
10371037
struct ips_scb *scb_freelist; /* SCB free list */
1038-
ips_wait_queue_t scb_waitlist; /* Pending SCB list */
1038+
ips_wait_queue_entry_t scb_waitlist; /* Pending SCB list */
10391039
ips_copp_queue_t copp_waitlist; /* Pending PT list */
10401040
ips_scb_queue_t scb_activelist; /* Active SCB list */
10411041
IPS_IO_CMD *dummy; /* dummy command */

drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3267,7 +3267,7 @@ int
32673267
kiblnd_connd(void *arg)
32683268
{
32693269
spinlock_t *lock = &kiblnd_data.kib_connd_lock;
3270-
wait_queue_t wait;
3270+
wait_queue_entry_t wait;
32713271
unsigned long flags;
32723272
struct kib_conn *conn;
32733273
int timeout;
@@ -3521,7 +3521,7 @@ kiblnd_scheduler(void *arg)
35213521
long id = (long)arg;
35223522
struct kib_sched_info *sched;
35233523
struct kib_conn *conn;
3524-
wait_queue_t wait;
3524+
wait_queue_entry_t wait;
35253525
unsigned long flags;
35263526
struct ib_wc wc;
35273527
int did_something;
@@ -3656,7 +3656,7 @@ kiblnd_failover_thread(void *arg)
36563656
{
36573657
rwlock_t *glock = &kiblnd_data.kib_global_lock;
36583658
struct kib_dev *dev;
3659-
wait_queue_t wait;
3659+
wait_queue_entry_t wait;
36603660
unsigned long flags;
36613661
int rc;
36623662

0 commit comments

Comments
 (0)