Lines Matching refs:head
77 static inline void list_add(struct list_head *new, struct list_head *head) in list_add() argument
79 __list_add(new, head, head->next); in list_add()
91 static inline void list_add_tail(struct list_head *new, struct list_head *head) in list_add_tail() argument
93 __list_add(new, head->prev, head); in list_add_tail()
168 static inline void list_move(struct list_head *list, struct list_head *head) in list_move() argument
171 list_add(list, head); in list_move()
180 struct list_head *head) in list_move_tail() argument
183 list_add_tail(list, head); in list_move_tail()
192 const struct list_head *head) in list_is_last() argument
194 return list->next == head; in list_is_last()
201 static inline int list_empty(const struct list_head *head) in list_empty() argument
203 return READ_ONCE(head->next) == head; in list_empty()
219 static inline int list_empty_careful(const struct list_head *head) in list_empty_careful() argument
221 struct list_head *next = head->next; in list_empty_careful()
222 return (next == head) && (next == head->prev); in list_empty_careful()
229 static inline void list_rotate_left(struct list_head *head) in list_rotate_left() argument
233 if (!list_empty(head)) { in list_rotate_left()
234 first = head->next; in list_rotate_left()
235 list_move_tail(first, head); in list_rotate_left()
243 static inline int list_is_singular(const struct list_head *head) in list_is_singular() argument
245 return !list_empty(head) && (head->next == head->prev); in list_is_singular()
249 struct list_head *head, struct list_head *entry) in __list_cut_position() argument
252 list->next = head->next; in __list_cut_position()
256 head->next = new_first; in __list_cut_position()
257 new_first->prev = head; in __list_cut_position()
275 struct list_head *head, struct list_head *entry) in list_cut_position() argument
277 if (list_empty(head)) in list_cut_position()
279 if (list_is_singular(head) && in list_cut_position()
280 (head->next != entry && head != entry)) in list_cut_position()
282 if (entry == head) in list_cut_position()
285 __list_cut_position(list, head, entry); in list_cut_position()
303 struct list_head *head, in list_cut_before() argument
306 if (head->next == entry) { in list_cut_before()
310 list->next = head->next; in list_cut_before()
314 head->next = entry; in list_cut_before()
315 entry->prev = head; in list_cut_before()
338 struct list_head *head) in list_splice() argument
341 __list_splice(list, head, head->next); in list_splice()
350 struct list_head *head) in list_splice_tail() argument
353 __list_splice(list, head->prev, head); in list_splice_tail()
364 struct list_head *head) in list_splice_init() argument
367 __list_splice(list, head, head->next); in list_splice_init()
381 struct list_head *head) in list_splice_tail_init() argument
384 __list_splice(list, head->prev, head); in list_splice_tail_init()
455 #define list_for_each(pos, head) \ argument
456 for (pos = (head)->next; pos != (head); pos = pos->next)
463 #define list_for_each_prev(pos, head) \ argument
464 for (pos = (head)->prev; pos != (head); pos = pos->prev)
472 #define list_for_each_safe(pos, n, head) \ argument
473 for (pos = (head)->next, n = pos->next; pos != (head); \
482 #define list_for_each_prev_safe(pos, n, head) \ argument
483 for (pos = (head)->prev, n = pos->prev; \
484 pos != (head); \
493 #define list_for_each_entry(pos, head, member) \ argument
494 for (pos = list_first_entry(head, typeof(*pos), member); \
495 &pos->member != (head); \
504 #define list_for_each_entry_reverse(pos, head, member) \ argument
505 for (pos = list_last_entry(head, typeof(*pos), member); \
506 &pos->member != (head); \
517 #define list_prepare_entry(pos, head, member) \ argument
518 ((pos) ? : list_entry(head, typeof(*pos), member))
529 #define list_for_each_entry_continue(pos, head, member) \ argument
531 &pos->member != (head); \
543 #define list_for_each_entry_continue_reverse(pos, head, member) \ argument
545 &pos->member != (head); \
556 #define list_for_each_entry_from(pos, head, member) \ argument
557 for (; &pos->member != (head); \
569 #define list_for_each_entry_from_reverse(pos, head, member) \ argument
570 for (; &pos->member != (head); \
580 #define list_for_each_entry_safe(pos, n, head, member) \ argument
581 for (pos = list_first_entry(head, typeof(*pos), member), \
583 &pos->member != (head); \
596 #define list_for_each_entry_safe_continue(pos, n, head, member) \ argument
599 &pos->member != (head); \
612 #define list_for_each_entry_safe_from(pos, n, head, member) \ argument
614 &pos->member != (head); \
627 #define list_for_each_entry_safe_reverse(pos, n, head, member) \ argument
628 for (pos = list_last_entry(head, typeof(*pos), member), \
630 &pos->member != (head); \
766 #define hlist_for_each(pos, head) \ argument
767 for (pos = (head)->first; pos ; pos = pos->next)
769 #define hlist_for_each_safe(pos, n, head) \ argument
770 for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \
784 #define hlist_for_each_entry(pos, head, member) \ argument
785 for (pos = hlist_entry_safe((head)->first, typeof(*(pos)), member);\
815 #define hlist_for_each_entry_safe(pos, n, head, member) \ argument
816 for (pos = hlist_entry_safe((head)->first, typeof(*pos), member);\