Lines Matching +full:entry +full:- +full:method

1 // SPDX-License-Identifier: GPL-2.0-only
6 #include "wait-queue.h"
8 #include <linux/device-mapper.h>
12 #include "status-codes.h"
15 * vdo_waitq_enqueue_waiter() - Add a waiter to the tail end of a waitq.
23 BUG_ON(waiter->next_waiter != NULL); in vdo_waitq_enqueue_waiter()
25 if (waitq->last_waiter == NULL) { in vdo_waitq_enqueue_waiter()
27 * The waitq is empty, so form the initial circular list by self-linking the in vdo_waitq_enqueue_waiter()
30 waiter->next_waiter = waiter; in vdo_waitq_enqueue_waiter()
33 waiter->next_waiter = waitq->last_waiter->next_waiter; in vdo_waitq_enqueue_waiter()
34 waitq->last_waiter->next_waiter = waiter; in vdo_waitq_enqueue_waiter()
38 waitq->last_waiter = waiter; in vdo_waitq_enqueue_waiter()
39 waitq->length += 1; in vdo_waitq_enqueue_waiter()
43 * vdo_waitq_transfer_all_waiters() - Transfer all waiters from one waitq to
57 * Both are non-empty. Splice the two circular lists together in vdo_waitq_transfer_all_waiters()
60 struct vdo_waiter *from_head = from_waitq->last_waiter->next_waiter; in vdo_waitq_transfer_all_waiters()
61 struct vdo_waiter *to_head = to_waitq->last_waiter->next_waiter; in vdo_waitq_transfer_all_waiters()
63 to_waitq->last_waiter->next_waiter = from_head; in vdo_waitq_transfer_all_waiters()
64 from_waitq->last_waiter->next_waiter = to_head; in vdo_waitq_transfer_all_waiters()
67 to_waitq->last_waiter = from_waitq->last_waiter; in vdo_waitq_transfer_all_waiters()
68 to_waitq->length += from_waitq->length; in vdo_waitq_transfer_all_waiters()
73 * vdo_waitq_notify_all_waiters() - Notify all the entries waiting in a waitq.
95 /* Drain the copied waitq, invoking the callback on every entry. */ in vdo_waitq_notify_all_waiters()
101 * vdo_waitq_get_first_waiter() - Return the waiter that is at the head end of a waitq.
108 struct vdo_waiter *last_waiter = waitq->last_waiter; in vdo_waitq_get_first_waiter()
115 /* The waitq is circular, so the last entry links to the head of the waitq. */ in vdo_waitq_get_first_waiter()
116 return last_waiter->next_waiter; in vdo_waitq_get_first_waiter()
120 * vdo_waitq_dequeue_matching_waiters() - Remove all waiters that match based on the specified
121 * matching method and append them to a vdo_wait_queue.
123 * @waiter_match: The method to determine matching.
124 * @match_context: Contextual info for the match method.
146 * vdo_waitq_dequeue_waiter() - Remove the first (oldest) waiter from a waitq.
147 * @waitq: The vdo_wait_queue from which to remove the first entry.
157 struct vdo_waiter *last_waiter = waitq->last_waiter; in vdo_waitq_dequeue_waiter()
163 /* The waitq has a single entry, so empty it by nulling the tail. */ in vdo_waitq_dequeue_waiter()
164 waitq->last_waiter = NULL; in vdo_waitq_dequeue_waiter()
170 last_waiter->next_waiter = first_waiter->next_waiter; in vdo_waitq_dequeue_waiter()
174 first_waiter->next_waiter = NULL; in vdo_waitq_dequeue_waiter()
175 waitq->length -= 1; in vdo_waitq_dequeue_waiter()
181 * vdo_waitq_notify_next_waiter() - Notify the next entry waiting in a waitq.
187 * Notifies the next entry waiting in a waitq to continue execution by invoking a callback function
201 callback = waiter->callback; in vdo_waitq_notify_next_waiter()