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()
199 static inline void list_move(struct list_head *list, struct list_head *head) in list_move() argument
202 list_add(list, head); in list_move()
211 struct list_head *head) in list_move_tail() argument
214 list_add_tail(list, head); in list_move_tail()
226 static inline void list_bulk_move_tail(struct list_head *head, in list_bulk_move_tail() argument
233 head->prev->next = first; in list_bulk_move_tail()
234 first->prev = head->prev; in list_bulk_move_tail()
236 last->next = head; in list_bulk_move_tail()
237 head->prev = last; in list_bulk_move_tail()
246 const struct list_head *head) in list_is_first() argument
248 return list->prev == head; in list_is_first()
257 const struct list_head *head) in list_is_last() argument
259 return list->next == head; in list_is_last()
266 static inline int list_empty(const struct list_head *head) in list_empty() argument
268 return READ_ONCE(head->next) == head; in list_empty()
284 static inline int list_empty_careful(const struct list_head *head) in list_empty_careful() argument
286 struct list_head *next = head->next; in list_empty_careful()
287 return (next == head) && (next == head->prev); in list_empty_careful()
294 static inline void list_rotate_left(struct list_head *head) in list_rotate_left() argument
298 if (!list_empty(head)) { in list_rotate_left()
299 first = head->next; in list_rotate_left()
300 list_move_tail(first, head); in list_rotate_left()
312 struct list_head *head) in list_rotate_to_front() argument
319 list_move_tail(head, list); in list_rotate_to_front()
326 static inline int list_is_singular(const struct list_head *head) in list_is_singular() argument
328 return !list_empty(head) && (head->next == head->prev); in list_is_singular()
332 struct list_head *head, struct list_head *entry) in __list_cut_position() argument
335 list->next = head->next; in __list_cut_position()
339 head->next = new_first; in __list_cut_position()
340 new_first->prev = head; in __list_cut_position()
358 struct list_head *head, struct list_head *entry) in list_cut_position() argument
360 if (list_empty(head)) in list_cut_position()
362 if (list_is_singular(head) && in list_cut_position()
363 (head->next != entry && head != entry)) in list_cut_position()
365 if (entry == head) in list_cut_position()
368 __list_cut_position(list, head, entry); in list_cut_position()
386 struct list_head *head, in list_cut_before() argument
389 if (head->next == entry) { in list_cut_before()
393 list->next = head->next; in list_cut_before()
397 head->next = entry; in list_cut_before()
398 entry->prev = head; in list_cut_before()
421 struct list_head *head) in list_splice() argument
424 __list_splice(list, head, head->next); in list_splice()
433 struct list_head *head) in list_splice_tail() argument
436 __list_splice(list, head->prev, head); in list_splice_tail()
447 struct list_head *head) in list_splice_init() argument
450 __list_splice(list, head, head->next); in list_splice_init()
464 struct list_head *head) in list_splice_tail_init() argument
467 __list_splice(list, head->prev, head); in list_splice_tail_init()
538 #define list_for_each(pos, head) \ argument
539 for (pos = (head)->next; pos != (head); pos = pos->next)
546 #define list_for_each_prev(pos, head) \ argument
547 for (pos = (head)->prev; pos != (head); pos = pos->prev)
555 #define list_for_each_safe(pos, n, head) \ argument
556 for (pos = (head)->next, n = pos->next; pos != (head); \
565 #define list_for_each_prev_safe(pos, n, head) \ argument
566 for (pos = (head)->prev, n = pos->prev; \
567 pos != (head); \
576 #define list_for_each_entry(pos, head, member) \ argument
577 for (pos = list_first_entry(head, typeof(*pos), member); \
578 &pos->member != (head); \
587 #define list_for_each_entry_reverse(pos, head, member) \ argument
588 for (pos = list_last_entry(head, typeof(*pos), member); \
589 &pos->member != (head); \
600 #define list_prepare_entry(pos, head, member) \ argument
601 ((pos) ? : list_entry(head, typeof(*pos), member))
612 #define list_for_each_entry_continue(pos, head, member) \ argument
614 &pos->member != (head); \
626 #define list_for_each_entry_continue_reverse(pos, head, member) \ argument
628 &pos->member != (head); \
639 #define list_for_each_entry_from(pos, head, member) \ argument
640 for (; &pos->member != (head); \
652 #define list_for_each_entry_from_reverse(pos, head, member) \ argument
653 for (; &pos->member != (head); \
663 #define list_for_each_entry_safe(pos, n, head, member) \ argument
664 for (pos = list_first_entry(head, typeof(*pos), member), \
666 &pos->member != (head); \
679 #define list_for_each_entry_safe_continue(pos, n, head, member) \ argument
682 &pos->member != (head); \
695 #define list_for_each_entry_safe_from(pos, n, head, member) \ argument
697 &pos->member != (head); \
710 #define list_for_each_entry_safe_reverse(pos, n, head, member) \ argument
711 for (pos = list_last_entry(head, typeof(*pos), member), \
713 &pos->member != (head); \
849 #define hlist_for_each(pos, head) \ argument
850 for (pos = (head)->first; pos ; pos = pos->next)
852 #define hlist_for_each_safe(pos, n, head) \ argument
853 for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \
867 #define hlist_for_each_entry(pos, head, member) \ argument
868 for (pos = hlist_entry_safe((head)->first, typeof(*(pos)), member);\
898 #define hlist_for_each_entry_safe(pos, n, head, member) \ argument
899 for (pos = hlist_entry_safe((head)->first, typeof(*pos), member);\