summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2017-03-05 11:25:39 +0100
committerIngo Molnar <mingo@kernel.org>2017-06-20 12:18:28 +0200
commit2141713616c652aeabf2dd5c1e89bc601c4fed6a (patch)
tree506baaf0994e1279805c4991bc904c5fbcaa9ed3 /kernel
parent9d9d676f595b5081326be7a17dc681fcb38fb3b2 (diff)
downloadlinux-2141713616c652aeabf2dd5c1e89bc601c4fed6a.tar.bz2
sched/wait: Standardize 'struct wait_bit_queue' wait-queue entry field name
Rename 'struct wait_bit_queue::wait' to ::wq_entry, to more clearly name it as a wait-queue entry. Propagate it to a couple of usage sites where the wait-bit-queue internals are exposed. 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 'kernel')
-rw-r--r--kernel/sched/wait.c41
1 files changed, 20 insertions, 21 deletions
diff --git a/kernel/sched/wait.c b/kernel/sched/wait.c
index 203aeea96f16..f1ba0625b8be 100644
--- a/kernel/sched/wait.c
+++ b/kernel/sched/wait.c
@@ -395,7 +395,7 @@ int wake_bit_function(struct wait_queue_entry *wq_entry, unsigned mode, int sync
{
struct wait_bit_key *key = arg;
struct wait_bit_queue *wait_bit
- = container_of(wq_entry, struct wait_bit_queue, wait);
+ = container_of(wq_entry, struct wait_bit_queue, wq_entry);
if (wait_bit->key.flags != key->flags ||
wait_bit->key.bit_nr != key->bit_nr ||
@@ -418,11 +418,11 @@ __wait_on_bit(struct wait_queue_head *wq_head, struct wait_bit_queue *q,
int ret = 0;
do {
- prepare_to_wait(wq_head, &q->wait, mode);
+ prepare_to_wait(wq_head, &q->wq_entry, mode);
if (test_bit(q->key.bit_nr, q->key.flags))
ret = (*action)(&q->key, mode);
} while (test_bit(q->key.bit_nr, q->key.flags) && !ret);
- finish_wait(wq_head, &q->wait);
+ finish_wait(wq_head, &q->wq_entry);
return ret;
}
EXPORT_SYMBOL(__wait_on_bit);
@@ -431,9 +431,9 @@ int __sched out_of_line_wait_on_bit(void *word, int bit,
wait_bit_action_f *action, unsigned mode)
{
struct wait_queue_head *wq_head = bit_waitqueue(word, bit);
- DEFINE_WAIT_BIT(wait, word, bit);
+ DEFINE_WAIT_BIT(wq_entry, word, bit);
- return __wait_on_bit(wq_head, &wait, action, mode);
+ return __wait_on_bit(wq_head, &wq_entry, action, mode);
}
EXPORT_SYMBOL(out_of_line_wait_on_bit);
@@ -442,10 +442,10 @@ int __sched out_of_line_wait_on_bit_timeout(
unsigned mode, unsigned long timeout)
{
struct wait_queue_head *wq_head = bit_waitqueue(word, bit);
- DEFINE_WAIT_BIT(wait, word, bit);
+ DEFINE_WAIT_BIT(wq_entry, word, bit);
- wait.key.timeout = jiffies + timeout;
- return __wait_on_bit(wq_head, &wait, action, mode);
+ wq_entry.key.timeout = jiffies + timeout;
+ return __wait_on_bit(wq_head, &wq_entry, action, mode);
}
EXPORT_SYMBOL_GPL(out_of_line_wait_on_bit_timeout);
@@ -456,7 +456,7 @@ __wait_on_bit_lock(struct wait_queue_head *wq_head, struct wait_bit_queue *q,
int ret = 0;
for (;;) {
- prepare_to_wait_exclusive(wq_head, &q->wait, mode);
+ prepare_to_wait_exclusive(wq_head, &q->wq_entry, mode);
if (test_bit(q->key.bit_nr, q->key.flags)) {
ret = action(&q->key, mode);
/*
@@ -466,11 +466,11 @@ __wait_on_bit_lock(struct wait_queue_head *wq_head, struct wait_bit_queue *q,
* smp_mb__after_atomic() before wake_up_page().
*/
if (ret)
- finish_wait(wq_head, &q->wait);
+ finish_wait(wq_head, &q->wq_entry);
}
if (!test_and_set_bit(q->key.bit_nr, q->key.flags)) {
if (!ret)
- finish_wait(wq_head, &q->wait);
+ finish_wait(wq_head, &q->wq_entry);
return 0;
} else if (ret) {
return ret;
@@ -483,9 +483,9 @@ int __sched out_of_line_wait_on_bit_lock(void *word, int bit,
wait_bit_action_f *action, unsigned mode)
{
struct wait_queue_head *wq_head = bit_waitqueue(word, bit);
- DEFINE_WAIT_BIT(wait, word, bit);
+ DEFINE_WAIT_BIT(wq_entry, word, bit);
- return __wait_on_bit_lock(wq_head, &wait, action, mode);
+ return __wait_on_bit_lock(wq_head, &wq_entry, action, mode);
}
EXPORT_SYMBOL(out_of_line_wait_on_bit_lock);
@@ -538,8 +538,7 @@ static int wake_atomic_t_function(struct wait_queue_entry *wq_entry, unsigned mo
void *arg)
{
struct wait_bit_key *key = arg;
- struct wait_bit_queue *wait_bit
- = container_of(wq_entry, struct wait_bit_queue, wait);
+ struct wait_bit_queue *wait_bit = container_of(wq_entry, struct wait_bit_queue, wq_entry);
atomic_t *val = key->flags;
if (wait_bit->key.flags != key->flags ||
@@ -562,24 +561,24 @@ int __wait_on_atomic_t(struct wait_queue_head *wq_head, struct wait_bit_queue *q
int ret = 0;
do {
- prepare_to_wait(wq_head, &q->wait, mode);
+ prepare_to_wait(wq_head, &q->wq_entry, mode);
val = q->key.flags;
if (atomic_read(val) == 0)
break;
ret = (*action)(val);
} while (!ret && atomic_read(val) != 0);
- finish_wait(wq_head, &q->wait);
+ finish_wait(wq_head, &q->wq_entry);
return ret;
}
#define DEFINE_WAIT_ATOMIC_T(name, p) \
struct wait_bit_queue name = { \
.key = __WAIT_ATOMIC_T_KEY_INITIALIZER(p), \
- .wait = { \
+ .wq_entry = { \
.private = current, \
.func = wake_atomic_t_function, \
.task_list = \
- LIST_HEAD_INIT((name).wait.task_list), \
+ LIST_HEAD_INIT((name).wq_entry.task_list), \
}, \
}
@@ -587,9 +586,9 @@ __sched int out_of_line_wait_on_atomic_t(atomic_t *p, int (*action)(atomic_t *),
unsigned mode)
{
struct wait_queue_head *wq_head = atomic_t_waitqueue(p);
- DEFINE_WAIT_ATOMIC_T(wait, p);
+ DEFINE_WAIT_ATOMIC_T(wq_entry, p);
- return __wait_on_atomic_t(wq_head, &wait, action, mode);
+ return __wait_on_atomic_t(wq_head, &wq_entry, action, mode);
}
EXPORT_SYMBOL(out_of_line_wait_on_atomic_t);