Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ac6424b9 authored by Ingo Molnar's avatar Ingo Molnar
Browse files

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: default avatarIngo Molnar <mingo@kernel.org>
parent 9705596d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -819,7 +819,7 @@ printk(KERN_INFO "my ip: %pI4\n", &amp;ipaddress);
   certain condition is true.  They must be used carefully to ensure
   there is no race condition.  You declare a
   <type>wait_queue_head_t</type>, and then processes which want to
   wait for that condition declare a <type>wait_queue_t</type>
   wait for that condition declare a <type>wait_queue_entry_t</type>
   referring to themselves, and place that in the queue.
  </para>

+6 −6
Original line number Diff line number Diff line
@@ -316,7 +316,7 @@ For version 5, the format of the message is:
        struct autofs_v5_packet {
                int proto_version;                /* Protocol version */
                int type;                        /* Type of packet */
                autofs_wqt_t wait_queue_token;
                autofs_wqt_t wait_queue_entry_token;
                __u32 dev;
                __u64 ino;
                __u32 uid;
@@ -341,12 +341,12 @@ The pipe will be set to "packet mode" (equivalent to passing
`O_DIRECT`) to _pipe2(2)_ so that a read from the pipe will return at
most one packet, and any unread portion of a packet will be discarded.

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

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

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

     is required.  This is filled in with the name of something
     that can be unmounted or removed.  If nothing can be expired,
     `errno` is set to `EAGAIN`.  Even though a `wait_queue_token`
     `errno` is set to `EAGAIN`.  Even though a `wait_queue_entry_token`
     is present in the structure, no "wait queue" is established
     and no acknowledgment is needed.
- **AUTOFS_IOC_EXPIRE_MULTI**:  This is similar to
+1 −1
Original line number Diff line number Diff line
@@ -926,7 +926,7 @@ static bool reorder_tags_to_front(struct list_head *list)
	return first != NULL;
}

static int blk_mq_dispatch_wake(wait_queue_t *wait, unsigned mode, int flags,
static int blk_mq_dispatch_wake(wait_queue_entry_t *wait, unsigned mode, int flags,
				void *key)
{
	struct blk_mq_hw_ctx *hctx;
+1 −1
Original line number Diff line number Diff line
@@ -503,7 +503,7 @@ static inline unsigned int get_limit(struct rq_wb *rwb, unsigned long rw)
}

static inline bool may_queue(struct rq_wb *rwb, struct rq_wait *rqw,
			     wait_queue_t *wait, unsigned long rw)
			     wait_queue_entry_t *wait, unsigned long rw)
{
	/*
	 * inc it here even if disabled, since we'll dec it at completion.
+4 −4
Original line number Diff line number Diff line
@@ -99,7 +99,7 @@ struct kyber_hctx_data {
	struct list_head rqs[KYBER_NUM_DOMAINS];
	unsigned int cur_domain;
	unsigned int batching;
	wait_queue_t domain_wait[KYBER_NUM_DOMAINS];
	wait_queue_entry_t domain_wait[KYBER_NUM_DOMAINS];
	atomic_t wait_index[KYBER_NUM_DOMAINS];
};

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

static int kyber_domain_wake(wait_queue_t *wait, unsigned mode, int flags,
static int kyber_domain_wake(wait_queue_entry_t *wait, unsigned mode, int flags,
			     void *key)
{
	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,
{
	unsigned int sched_domain = khd->cur_domain;
	struct sbitmap_queue *domain_tokens = &kqd->domain_tokens[sched_domain];
	wait_queue_t *wait = &khd->domain_wait[sched_domain];
	wait_queue_entry_t *wait = &khd->domain_wait[sched_domain];
	struct sbq_wait_state *ws;
	int nr;

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