Lines Matching refs:head

84 static inline void list_add(struct list_head *new, struct list_head *head)  in list_add()  argument
86 __list_add(new, head, head->next); in list_add()
98 static inline void list_add_tail(struct list_head *new, struct list_head *head) in list_add_tail() argument
100 __list_add(new, head->prev, head); in list_add_tail()
213 static inline void list_move(struct list_head *list, struct list_head *head) in list_move() argument
216 list_add(list, head); in list_move()
225 struct list_head *head) in list_move_tail() argument
228 list_add_tail(list, head); in list_move_tail()
240 static inline void list_bulk_move_tail(struct list_head *head, in list_bulk_move_tail() argument
247 head->prev->next = first; in list_bulk_move_tail()
248 first->prev = head->prev; in list_bulk_move_tail()
250 last->next = head; in list_bulk_move_tail()
251 head->prev = last; in list_bulk_move_tail()
260 const struct list_head *head) in list_is_first() argument
262 return list->prev == head; in list_is_first()
271 const struct list_head *head) in list_is_last() argument
273 return list->next == head; in list_is_last()
280 static inline int list_empty(const struct list_head *head) in list_empty() argument
282 return READ_ONCE(head->next) == head; in list_empty()
316 static inline int list_empty_careful(const struct list_head *head) in list_empty_careful() argument
318 struct list_head *next = smp_load_acquire(&head->next); in list_empty_careful()
319 return (next == head) && (next == head->prev); in list_empty_careful()
326 static inline void list_rotate_left(struct list_head *head) in list_rotate_left() argument
330 if (!list_empty(head)) { in list_rotate_left()
331 first = head->next; in list_rotate_left()
332 list_move_tail(first, head); in list_rotate_left()
344 struct list_head *head) in list_rotate_to_front() argument
351 list_move_tail(head, list); in list_rotate_to_front()
358 static inline int list_is_singular(const struct list_head *head) in list_is_singular() argument
360 return !list_empty(head) && (head->next == head->prev); in list_is_singular()
364 struct list_head *head, struct list_head *entry) in __list_cut_position() argument
367 list->next = head->next; in __list_cut_position()
371 head->next = new_first; in __list_cut_position()
372 new_first->prev = head; in __list_cut_position()
390 struct list_head *head, struct list_head *entry) in list_cut_position() argument
392 if (list_empty(head)) in list_cut_position()
394 if (list_is_singular(head) && in list_cut_position()
395 (head->next != entry && head != entry)) in list_cut_position()
397 if (entry == head) in list_cut_position()
400 __list_cut_position(list, head, entry); in list_cut_position()
418 struct list_head *head, in list_cut_before() argument
421 if (head->next == entry) { in list_cut_before()
425 list->next = head->next; in list_cut_before()
429 head->next = entry; in list_cut_before()
430 entry->prev = head; in list_cut_before()
453 struct list_head *head) in list_splice() argument
456 __list_splice(list, head, head->next); in list_splice()
465 struct list_head *head) in list_splice_tail() argument
468 __list_splice(list, head->prev, head); in list_splice_tail()
479 struct list_head *head) in list_splice_init() argument
482 __list_splice(list, head, head->next); in list_splice_init()
496 struct list_head *head) in list_splice_tail_init() argument
499 __list_splice(list, head->prev, head); in list_splice_tail_init()
570 #define list_for_each(pos, head) \ argument
571 for (pos = (head)->next; pos != (head); pos = pos->next)
580 #define list_for_each_continue(pos, head) \ argument
581 for (pos = pos->next; pos != (head); pos = pos->next)
588 #define list_for_each_prev(pos, head) \ argument
589 for (pos = (head)->prev; pos != (head); pos = pos->prev)
597 #define list_for_each_safe(pos, n, head) \ argument
598 for (pos = (head)->next, n = pos->next; pos != (head); \
607 #define list_for_each_prev_safe(pos, n, head) \ argument
608 for (pos = (head)->prev, n = pos->prev; \
609 pos != (head); \
618 #define list_entry_is_head(pos, head, member) \ argument
619 (&pos->member == (head))
627 #define list_for_each_entry(pos, head, member) \ argument
628 for (pos = list_first_entry(head, typeof(*pos), member); \
629 !list_entry_is_head(pos, head, member); \
638 #define list_for_each_entry_reverse(pos, head, member) \ argument
639 for (pos = list_last_entry(head, typeof(*pos), member); \
640 !list_entry_is_head(pos, head, member); \
651 #define list_prepare_entry(pos, head, member) \ argument
652 ((pos) ? : list_entry(head, typeof(*pos), member))
663 #define list_for_each_entry_continue(pos, head, member) \ argument
665 !list_entry_is_head(pos, head, member); \
677 #define list_for_each_entry_continue_reverse(pos, head, member) \ argument
679 !list_entry_is_head(pos, head, member); \
690 #define list_for_each_entry_from(pos, head, member) \ argument
691 for (; !list_entry_is_head(pos, head, member); \
703 #define list_for_each_entry_from_reverse(pos, head, member) \ argument
704 for (; !list_entry_is_head(pos, head, member); \
714 #define list_for_each_entry_safe(pos, n, head, member) \ argument
715 for (pos = list_first_entry(head, typeof(*pos), member), \
717 !list_entry_is_head(pos, head, member); \
730 #define list_for_each_entry_safe_continue(pos, n, head, member) \ argument
733 !list_entry_is_head(pos, head, member); \
746 #define list_for_each_entry_safe_from(pos, n, head, member) \ argument
748 !list_entry_is_head(pos, head, member); \
761 #define list_for_each_entry_safe_reverse(pos, n, head, member) \ argument
762 for (pos = list_last_entry(head, typeof(*pos), member), \
764 !list_entry_is_head(pos, head, member); \
974 #define hlist_for_each(pos, head) \ argument
975 for (pos = (head)->first; pos ; pos = pos->next)
977 #define hlist_for_each_safe(pos, n, head) \ argument
978 for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \
992 #define hlist_for_each_entry(pos, head, member) \ argument
993 for (pos = hlist_entry_safe((head)->first, typeof(*(pos)), member);\
1023 #define hlist_for_each_entry_safe(pos, n, head, member) \ argument
1024 for (pos = hlist_entry_safe((head)->first, typeof(*pos), member);\