Lines Matching full:list
14 * Circular doubly linked list implementation.
30 * @list: list_head structure to be initialized.
32 * Initializes the list_head to point to itself. If it is a list header,
33 * the result is an empty list.
35 static inline void INIT_LIST_HEAD(struct list_head *list) in INIT_LIST_HEAD() argument
37 WRITE_ONCE(list->next, list); in INIT_LIST_HEAD()
38 WRITE_ONCE(list->prev, list); in INIT_LIST_HEAD()
50 * Performs the full set of list corruption checks before __list_add().
51 * On list corruption reports a warning, and returns false.
58 * Performs list corruption checks before __list_add(). Returns false if a
61 * With CONFIG_LIST_HARDENED only, performs minimal list integrity checking
93 * Performs the full set of list corruption checks before __list_del_entry().
94 * On list corruption reports a warning, and returns false.
99 * Performs list corruption checks before __list_del_entry(). Returns false if a
102 * With CONFIG_LIST_HARDENED only, performs minimal list integrity checking
143 * This is only for internal list manipulation where we know
162 * @head: list head to add it after
176 * @head: list head to add it before
187 * Delete a list entry by making the prev/next entries
190 * This is only for internal list manipulation where we know
200 * Delete a list entry and clear the 'prev' pointer.
202 * This is a special-purpose list clearing method used in the networking code
222 * list_del - deletes entry from list.
223 * @entry: the element to delete from the list.
282 * list_del_init - deletes entry from list and reinitialize it.
283 * @entry: the element to delete from the list.
292 * list_move - delete from one list and add as another's head
293 * @list: the entry to move
296 static inline void list_move(struct list_head *list, struct list_head *head) in list_move() argument
298 __list_del_entry(list); in list_move()
299 list_add(list, head); in list_move()
303 * list_move_tail - delete from one list and add as another's tail
304 * @list: the entry to move
307 static inline void list_move_tail(struct list_head *list, in list_move_tail() argument
310 __list_del_entry(list); in list_move_tail()
311 list_add_tail(list, head); in list_move_tail()
315 * list_bulk_move_tail - move a subsection of a list to its tail
321 * All three entries must belong to the same linked list.
338 * list_is_first -- tests whether @list is the first entry in list @head
339 * @list: the entry to test
340 * @head: the head of the list
342 static inline int list_is_first(const struct list_head *list, const struct list_head *head) in list_is_first() argument
344 return list->prev == head; in list_is_first()
348 * list_is_last - tests whether @list is the last entry in list @head
349 * @list: the entry to test
350 * @head: the head of the list
352 static inline int list_is_last(const struct list_head *list, const struct list_head *head) in list_is_last() argument
354 return list->next == head; in list_is_last()
358 * list_is_head - tests whether @list is the list @head
359 * @list: the entry to test
360 * @head: the head of the list
362 static inline int list_is_head(const struct list_head *list, const struct list_head *head) in list_is_head() argument
364 return list == head; in list_is_head()
368 * list_empty - tests whether a list is empty
369 * @head: the list to test.
377 * list_del_init_careful - deletes entry from list and reinitialize it.
378 * @entry: the element to delete from the list.
395 * list_empty_careful - tests whether a list is empty and not being modified
396 * @head: the list to test
399 * tests whether a list is empty _and_ checks that no other CPU might be
404 * to the list entry is list_del_init(). Eg. it cannot be used
414 * list_rotate_left - rotate the list to the left
415 * @head: the head of the list
428 * list_rotate_to_front() - Rotate list to specific item.
429 * @list: The desired new front of the list.
430 * @head: The head of the list.
432 * Rotates list so that @list becomes the new front of the list.
434 static inline void list_rotate_to_front(struct list_head *list, in list_rotate_to_front() argument
438 * Deletes the list head from the list denoted by @head and in list_rotate_to_front()
439 * places it as the tail of @list, this effectively rotates the in list_rotate_to_front()
440 * list so that @list is at the front. in list_rotate_to_front()
442 list_move_tail(head, list); in list_rotate_to_front()
446 * list_is_singular - tests whether a list has just one entry.
447 * @head: the list to test.
454 static inline void __list_cut_position(struct list_head *list, in __list_cut_position() argument
458 list->next = head->next; in __list_cut_position()
459 list->next->prev = list; in __list_cut_position()
460 list->prev = entry; in __list_cut_position()
461 entry->next = list; in __list_cut_position()
467 * list_cut_position - cut a list into two
468 * @list: a new list to add all removed entries
469 * @head: a list with entries
471 * and if so we won't cut the list
474 * including @entry, from @head to @list. You should
475 * pass on @entry an element you know is on @head. @list
476 * should be an empty list or a list you do not care about
480 static inline void list_cut_position(struct list_head *list, in list_cut_position() argument
488 INIT_LIST_HEAD(list); in list_cut_position()
490 __list_cut_position(list, head, entry); in list_cut_position()
494 * list_cut_before - cut a list into two, before given entry
495 * @list: a new list to add all removed entries
496 * @head: a list with entries
500 * excluding @entry, from @head to @list. You should pass
501 * in @entry an element you know is on @head. @list should
502 * be an empty list or a list you do not care about losing
505 * @list.
507 static inline void list_cut_before(struct list_head *list, in list_cut_before() argument
512 INIT_LIST_HEAD(list); in list_cut_before()
515 list->next = head->next; in list_cut_before()
516 list->next->prev = list; in list_cut_before()
517 list->prev = entry->prev; in list_cut_before()
518 list->prev->next = list; in list_cut_before()
523 static inline void __list_splice(const struct list_head *list, in __list_splice() argument
527 struct list_head *first = list->next; in __list_splice()
528 struct list_head *last = list->prev; in __list_splice()
539 * @list: the new list to add.
540 * @head: the place to add it in the first list.
542 static inline void list_splice(const struct list_head *list, in list_splice() argument
545 if (!list_empty(list)) in list_splice()
546 __list_splice(list, head, head->next); in list_splice()
550 * list_splice_tail - join two lists, each list being a queue
551 * @list: the new list to add.
552 * @head: the place to add it in the first list.
554 static inline void list_splice_tail(struct list_head *list, in list_splice_tail() argument
557 if (!list_empty(list)) in list_splice_tail()
558 __list_splice(list, head->prev, head); in list_splice_tail()
562 * list_splice_init - join two lists and reinitialise the emptied list.
563 * @list: the new list to add.
564 * @head: the place to add it in the first list.
566 * The list at @list is reinitialised
568 static inline void list_splice_init(struct list_head *list, in list_splice_init() argument
571 if (!list_empty(list)) { in list_splice_init()
572 __list_splice(list, head, head->next); in list_splice_init()
573 INIT_LIST_HEAD(list); in list_splice_init()
578 * list_splice_tail_init - join two lists and reinitialise the emptied list
579 * @list: the new list to add.
580 * @head: the place to add it in the first list.
583 * The list at @list is reinitialised
585 static inline void list_splice_tail_init(struct list_head *list, in list_splice_tail_init() argument
588 if (!list_empty(list)) { in list_splice_tail_init()
589 __list_splice(list, head->prev, head); in list_splice_tail_init()
590 INIT_LIST_HEAD(list); in list_splice_tail_init()
604 * list_first_entry - get the first element from a list
605 * @ptr: the list head to take the element from.
609 * Note, that list is expected to be not empty.
615 * list_last_entry - get the last element from a list
616 * @ptr: the list head to take the element from.
620 * Note, that list is expected to be not empty.
626 * list_first_entry_or_null - get the first element from a list
627 * @ptr: the list head to take the element from.
631 * Note that if the list is empty, it returns NULL.
640 * list_next_entry - get the next element in list
648 * list_next_entry_circular - get the next element in list
650 * @head: the list head to take the element from.
654 * Note, that list is expected to be not empty.
661 * list_prev_entry - get the prev element in list
669 * list_prev_entry_circular - get the prev element in list
671 * @head: the list head to take the element from.
675 * Note, that list is expected to be not empty.
682 * list_for_each - iterate over a list
684 * @head: the head for your list.
690 * list_for_each_rcu - Iterate over a list in an RCU-safe fashion
692 * @head: the head for your list.
700 * list_for_each_continue - continue iteration over a list
702 * @head: the head for your list.
704 * Continue to iterate over a list, continuing after the current position.
710 * list_for_each_prev - iterate over a list backwards
712 * @head: the head for your list.
718 * list_for_each_safe - iterate over a list safe against removal of list entry
721 * @head: the head for your list.
729 * list_for_each_prev_safe - iterate over a list backwards safe against removal of list entry
732 * @head: the head for your list.
740 * list_count_nodes - count nodes in the list
741 * @head: the head for your list.
755 * list_entry_is_head - test if the entry points to the head of the list
757 * @head: the head for your list.
764 * list_for_each_entry - iterate over list of given type
766 * @head: the head for your list.
775 * list_for_each_entry_reverse - iterate backwards over list of given type.
777 * @head: the head for your list.
788 * @head: the head of the list
797 * list_for_each_entry_continue - continue iteration over list of given type
799 * @head: the head for your list.
802 * Continue to iterate over list of given type, continuing after
813 * @head: the head for your list.
816 * Start to iterate over list of given type backwards, continuing after
825 * list_for_each_entry_from - iterate over list of given type from the current point
827 * @head: the head for your list.
830 * Iterate over list of given type, continuing from current position.
837 * list_for_each_entry_from_reverse - iterate backwards over list of given type
840 * @head: the head for your list.
843 * Iterate backwards over list of given type, continuing from current position.
850 * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
853 * @head: the head for your list.
863 * list_for_each_entry_safe_continue - continue list iteration safe against removal
866 * @head: the head for your list.
869 * Iterate over list of given type, continuing after current point,
870 * safe against removal of list entry.
879 * list_for_each_entry_safe_from - iterate over list from current point safe against removal
882 * @head: the head for your list.
885 * Iterate over list of given type from current point, safe against
886 * removal of list entry.
894 * list_for_each_entry_safe_reverse - iterate backwards over list safe against removal
897 * @head: the head for your list.
900 * Iterate backwards over list of given type, safe against removal
901 * of list entry.
915 * list_safe_reset_next is not safe to use in general if the list may be
917 * exception to this is if the cursor element (pos) is pinned in the list,
925 * Double linked lists with a single pointer list head.
926 * Mostly useful for hash tables where the two pointer list head is
941 * hlist_unhashed - Has node been removed from list and reinitialized?
986 * hlist_del - Delete the specified hlist_node from its list
1000 * hlist_del_init - Delete the specified hlist_node from its list and initialize
1063 * @n: Node to make a fake list out of
1067 * in cases where there is no list.
1086 * @h: Header for potentially singular list.
1099 * @old: hlist_head for old list.
1100 * @new: hlist_head for new list.
1102 * Move a list from one list head to another. Fixup the pprev
1115 * hlist_splice_init() - move all entries from one list to another
1117 * @last: last entry on the @from list
1149 * hlist_for_each_entry - iterate over list of given type
1151 * @head: the head for your list.
1179 * hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry
1182 * @head: the head for your list.