Lines Matching defs:list

18  * Simple doubly linked list implementation.
31 static inline void INIT_LIST_HEAD(struct list_head *list)
33 list->next = list;
34 list->prev = list;
40 * This is only for internal list manipulation where we know
56 * @head: list head to add it after
69 * @head: list head to add it before
80 * Delete a list entry by making the prev/next entries
83 * This is only for internal list manipulation where we know
93 * list_del - deletes entry from list.
94 * @entry: the element to delete from the list.
129 * list_del_init - deletes entry from list and reinitialize it.
130 * @entry: the element to delete from the list.
139 * list_move - delete from one list and add as another's head
140 * @list: the entry to move
143 static inline void list_move(struct list_head *list, struct list_head *head)
145 __list_del(list->prev, list->next);
146 list_add(list, head);
150 * list_move_tail - delete from one list and add as another's tail
151 * @list: the entry to move
154 static inline void list_move_tail(struct list_head *list,
157 __list_del(list->prev, list->next);
158 list_add_tail(list, head);
162 * list_is_last - tests whether @list is the last entry in list @head
163 * @list: the entry to test
164 * @head: the head of the list
166 static inline int list_is_last(const struct list_head *list,
169 return list->next == head;
173 * list_empty - tests whether a list is empty
174 * @head: the list to test.
182 * list_empty_careful - tests whether a list is empty and not being modified
183 * @head: the list to test
186 * tests whether a list is empty _and_ checks that no other CPU might be
191 * to the list entry is list_del_init(). Eg. it cannot be used
201 * list_is_singular - tests whether a list has just one entry.
202 * @head: the list to test.
209 static inline void __list_cut_position(struct list_head *list,
213 list->next = head->next;
214 list->next->prev = list;
215 list->prev = entry;
216 entry->next = list;
222 * list_cut_position - cut a list into two
223 * @list: a new list to add all removed entries
224 * @head: a list with entries
226 * and if so we won't cut the list
229 * including @entry, from @head to @list. You should
230 * pass on @entry an element you know is on @head. @list
231 * should be an empty list or a list you do not care about
235 static inline void list_cut_position(struct list_head *list,
244 INIT_LIST_HEAD(list);
246 __list_cut_position(list, head, entry);
249 static inline void __list_splice(const struct list_head *list,
253 struct list_head *first = list->next;
254 struct list_head *last = list->prev;
265 * @list: the new list to add.
266 * @head: the place to add it in the first list.
268 static inline void list_splice(const struct list_head *list,
271 if (!list_empty(list))
272 __list_splice(list, head, head->next);
276 * list_splice_tail - join two lists, each list being a queue
277 * @list: the new list to add.
278 * @head: the place to add it in the first list.
280 static inline void list_splice_tail(struct list_head *list,
283 if (!list_empty(list))
284 __list_splice(list, head->prev, head);
288 * list_splice_init - join two lists and reinitialise the emptied list.
289 * @list: the new list to add.
290 * @head: the place to add it in the first list.
292 * The list at @list is reinitialised
294 static inline void list_splice_init(struct list_head *list,
297 if (!list_empty(list)) {
298 __list_splice(list, head, head->next);
299 INIT_LIST_HEAD(list);
304 * list_splice_tail_init - join two lists and reinitialise the emptied list
305 * @list: the new list to add.
306 * @head: the place to add it in the first list.
309 * The list at @list is reinitialised
311 static inline void list_splice_tail_init(struct list_head *list,
314 if (!list_empty(list)) {
315 __list_splice(list, head->prev, head);
316 INIT_LIST_HEAD(list);
330 * list_first_entry - get the first element from a list
331 * @ptr: the list head to take the element from.
335 * Note, that list is expected to be not empty.
341 * list_for_each - iterate over a list
343 * @head: the head for your list.
350 * __list_for_each - iterate over a list
352 * @head: the head for your list.
355 * simplest possible list iteration code, no prefetching is done.
356 * Use this for code that knows the list to be very short (empty
363 * list_for_each_prev - iterate over a list backwards
365 * @head: the head for your list.
372 * list_for_each_safe - iterate over a list safe against removal of list entry
375 * @head: the head for your list.
382 * list_for_each_prev_safe - iterate over a list backwards safe against removal of list entry
385 * @head: the head for your list.
393 * list_for_each_entry - iterate over list of given type
395 * @head: the head for your list.
404 * list_for_each_entry_reverse - iterate backwards over list of given type.
406 * @head: the head for your list.
417 * @head: the head of the list
426 * list_for_each_entry_continue - continue iteration over list of given type
428 * @head: the head for your list.
431 * Continue to iterate over list of given type, continuing after
442 * @head: the head for your list.
445 * Start to iterate over list of given type backwards, continuing after
454 * list_for_each_entry_from - iterate over list of given type from the current point
456 * @head: the head for your list.
459 * Iterate over list of given type, continuing from current position.
466 * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
469 * @head: the head for your list.
482 * @head: the head for your list.
485 * Iterate over list of given type, continuing after current point,
486 * safe against removal of list entry.
498 * @head: the head for your list.
501 * Iterate over list of given type from current point, safe against
502 * removal of list entry.
513 * @head: the head for your list.
516 * Iterate backwards over list of given type, safe against removal
517 * of list entry.
526 * Double linked lists with a single pointer list head.
527 * Mostly useful for hash tables where the two pointer list head is
625 * hlist_for_each_entry - iterate over list of given type
628 * @head: the head for your list.
661 * hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry
665 * @head: the head for your list.