Lines Matching refs:head
61 static inline void list_add(struct list_head *new, struct list_head *head) in list_add() argument
63 __list_add(new, head, head->next); in list_add()
75 static inline void list_add_tail(struct list_head *new, struct list_head *head) in list_add_tail() argument
77 __list_add(new, head->prev, head); in list_add_tail()
154 static inline void list_move(struct list_head *list, struct list_head *head) in list_move() argument
157 list_add(list, head); in list_move()
166 struct list_head *head) in list_move_tail() argument
169 list_add_tail(list, head); in list_move_tail()
178 const struct list_head *head) in list_is_last() argument
180 return list->next == head; in list_is_last()
187 static inline int list_empty(const struct list_head *head) in list_empty() argument
189 return head->next == head; in list_empty()
205 static inline int list_empty_careful(const struct list_head *head) in list_empty_careful() argument
207 struct list_head *next = head->next; in list_empty_careful()
208 return (next == head) && (next == head->prev); in list_empty_careful()
215 static inline void list_rotate_left(struct list_head *head) in list_rotate_left() argument
219 if (!list_empty(head)) { in list_rotate_left()
220 first = head->next; in list_rotate_left()
221 list_move_tail(first, head); in list_rotate_left()
229 static inline int list_is_singular(const struct list_head *head) in list_is_singular() argument
231 return !list_empty(head) && (head->next == head->prev); in list_is_singular()
235 struct list_head *head, struct list_head *entry) in __list_cut_position() argument
238 list->next = head->next; in __list_cut_position()
242 head->next = new_first; in __list_cut_position()
243 new_first->prev = head; in __list_cut_position()
261 struct list_head *head, struct list_head *entry) in list_cut_position() argument
263 if (list_empty(head)) in list_cut_position()
265 if (list_is_singular(head) && in list_cut_position()
266 (head->next != entry && head != entry)) in list_cut_position()
268 if (entry == head) in list_cut_position()
271 __list_cut_position(list, head, entry); in list_cut_position()
294 struct list_head *head) in list_splice() argument
297 __list_splice(list, head, head->next); in list_splice()
306 struct list_head *head) in list_splice_tail() argument
309 __list_splice(list, head->prev, head); in list_splice_tail()
320 struct list_head *head) in list_splice_init() argument
323 __list_splice(list, head, head->next); in list_splice_init()
337 struct list_head *head) in list_splice_tail_init() argument
340 __list_splice(list, head->prev, head); in list_splice_tail_init()
408 #define list_for_each(pos, head) \ argument
409 for (pos = (head)->next; pos != (head); pos = pos->next)
416 #define list_for_each_prev(pos, head) \ argument
417 for (pos = (head)->prev; pos != (head); pos = pos->prev)
425 #define list_for_each_safe(pos, n, head) \ argument
426 for (pos = (head)->next, n = pos->next; pos != (head); \
435 #define list_for_each_prev_safe(pos, n, head) \ argument
436 for (pos = (head)->prev, n = pos->prev; \
437 pos != (head); \
446 #define list_for_each_entry(pos, head, member) \ argument
447 for (pos = list_first_entry(head, typeof(*pos), member); \
448 &pos->member != (head); \
457 #define list_for_each_entry_reverse(pos, head, member) \ argument
458 for (pos = list_last_entry(head, typeof(*pos), member); \
459 &pos->member != (head); \
470 #define list_prepare_entry(pos, head, member) \ argument
471 ((pos) ? : list_entry(head, typeof(*pos), member))
482 #define list_for_each_entry_continue(pos, head, member) \ argument
484 &pos->member != (head); \
496 #define list_for_each_entry_continue_reverse(pos, head, member) \ argument
498 &pos->member != (head); \
509 #define list_for_each_entry_from(pos, head, member) \ argument
510 for (; &pos->member != (head); \
520 #define list_for_each_entry_safe(pos, n, head, member) \ argument
521 for (pos = list_first_entry(head, typeof(*pos), member), \
523 &pos->member != (head); \
536 #define list_for_each_entry_safe_continue(pos, n, head, member) \ argument
539 &pos->member != (head); \
552 #define list_for_each_entry_safe_from(pos, n, head, member) \ argument
554 &pos->member != (head); \
567 #define list_for_each_entry_safe_reverse(pos, n, head, member) \ argument
568 for (pos = list_last_entry(head, typeof(*pos), member), \
570 &pos->member != (head); \
696 #define hlist_for_each(pos, head) \ argument
697 for (pos = (head)->first; pos ; pos = pos->next)
699 #define hlist_for_each_safe(pos, n, head) \ argument
700 for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \
714 #define hlist_for_each_entry(pos, head, member) \ argument
715 for (pos = hlist_entry_safe((head)->first, typeof(*(pos)), member);\
745 #define hlist_for_each_entry_safe(pos, n, head, member) \ argument
746 for (pos = hlist_entry_safe((head)->first, typeof(*pos), member);\