Lines Matching +full:key +full:- +full:release

1 // SPDX-License-Identifier: GPL-2.0-only
23 struct wait_bit_key *key = arg; in wake_bit_function() local
26 if (wait_bit->key.flags != key->flags || in wake_bit_function()
27 wait_bit->key.bit_nr != key->bit_nr || in wake_bit_function()
28 test_bit(key->bit_nr, key->flags)) in wake_bit_function()
31 return autoremove_wake_function(wq_entry, mode, sync, key); in wake_bit_function()
36 * To allow interruptible waiting and asynchronous (i.e. non-blocking)
47 prepare_to_wait(wq_head, &wbq_entry->wq_entry, mode); in __wait_on_bit()
48 if (test_bit(wbq_entry->key.bit_nr, wbq_entry->key.flags)) in __wait_on_bit()
49 ret = (*action)(&wbq_entry->key, mode); in __wait_on_bit()
50 } while (test_bit_acquire(wbq_entry->key.bit_nr, wbq_entry->key.flags) && !ret); in __wait_on_bit()
52 finish_wait(wq_head, &wbq_entry->wq_entry); in __wait_on_bit()
75 wq_entry.key.timeout = jiffies + timeout; in out_of_line_wait_on_bit_timeout()
88 prepare_to_wait_exclusive(wq_head, &wbq_entry->wq_entry, mode); in __wait_on_bit_lock()
89 if (test_bit(wbq_entry->key.bit_nr, wbq_entry->key.flags)) { in __wait_on_bit_lock()
90 ret = action(&wbq_entry->key, mode); in __wait_on_bit_lock()
93 * finish_wait() does not necessarily takes wwq_head->lock, in __wait_on_bit_lock()
98 finish_wait(wq_head, &wbq_entry->wq_entry); in __wait_on_bit_lock()
100 if (!test_and_set_bit(wbq_entry->key.bit_nr, wbq_entry->key.flags)) { in __wait_on_bit_lock()
102 finish_wait(wq_head, &wbq_entry->wq_entry); in __wait_on_bit_lock()
123 struct wait_bit_key key = __WAIT_BIT_KEY_INITIALIZER(word, bit); in __wake_up_bit() local
126 __wake_up(wq_head, TASK_NORMAL, 1, &key); in __wake_up_bit()
131 * wake_up_bit - wake up waiters on a bit
138 * The wake-up is sent to tasks in a waitqueue selected by hash from a
147 * If the bit was cleared with a fully-ordered operation, no further
150 * Normally the bit should be cleared by an operation with RELEASE
171 struct wait_bit_key *key = arg; in var_wake_function() local
175 if (wbq_entry->key.flags != key->flags || in var_wake_function()
176 wbq_entry->key.bit_nr != key->bit_nr) in var_wake_function()
179 return autoremove_wake_function(wq_entry, mode, sync, key); in var_wake_function()
185 .key = { in init_wait_var_entry()
187 .bit_nr = -1, in init_wait_var_entry()
193 .entry = LIST_HEAD_INIT(wbq_entry->wq_entry.entry), in init_wait_var_entry()
200 * wake_up_var - wake up waiters on a variable (kernel address)
210 * The wake-up is sent to tasks in a waitqueue selected by hash from a
224 * to be true) by an operation with RELEASE semantics such as
231 __wake_up_bit(__var_waitqueue(var), var, -1); in wake_up_var()
239 return -EINTR; in bit_wait()
249 return -EINTR; in bit_wait_io()
259 if (time_after_eq(now, word->timeout)) in bit_wait_timeout()
260 return -EAGAIN; in bit_wait_timeout()
261 schedule_timeout(word->timeout - now); in bit_wait_timeout()
263 return -EINTR; in bit_wait_timeout()