Lines Matching refs:head
56 static inline void list_add(struct list_head *new, struct list_head *head) in list_add() argument
58 __list_add(new, head, head->next); in list_add()
69 static inline void list_add_tail(struct list_head *new, struct list_head *head) in list_add_tail() argument
71 __list_add(new, head->prev, head); in list_add_tail()
138 static inline void list_move(struct list_head *list, struct list_head *head) in list_move() argument
141 list_add(list, head); in list_move()
150 struct list_head *head) in list_move_tail() argument
153 list_add_tail(list, head); in list_move_tail()
162 const struct list_head *head) in list_is_last() argument
164 return list->next == head; in list_is_last()
172 static inline int list_is_head(const struct list_head *list, const struct list_head *head) in list_is_head() argument
174 return list == head; in list_is_head()
181 static inline int list_empty(const struct list_head *head) in list_empty() argument
183 return head->next == head; in list_empty()
199 static inline int list_empty_careful(const struct list_head *head) in list_empty_careful() argument
201 struct list_head *next = head->next; in list_empty_careful()
202 return (next == head) && (next == head->prev); in list_empty_careful()
209 static inline int list_is_singular(const struct list_head *head) in list_is_singular() argument
211 return !list_empty(head) && (head->next == head->prev); in list_is_singular()
215 struct list_head *head, struct list_head *entry) in __list_cut_position() argument
218 list->next = head->next; in __list_cut_position()
222 head->next = new_first; in __list_cut_position()
223 new_first->prev = head; in __list_cut_position()
241 struct list_head *head, struct list_head *entry) in list_cut_position() argument
243 if (list_empty(head)) in list_cut_position()
245 if (list_is_singular(head) && in list_cut_position()
246 (head->next != entry && head != entry)) in list_cut_position()
248 if (entry == head) in list_cut_position()
251 __list_cut_position(list, head, entry); in list_cut_position()
274 struct list_head *head) in list_splice() argument
277 __list_splice(list, head, head->next); in list_splice()
286 struct list_head *head) in list_splice_tail() argument
289 __list_splice(list, head->prev, head); in list_splice_tail()
300 struct list_head *head) in list_splice_init() argument
303 __list_splice(list, head, head->next); in list_splice_init()
317 struct list_head *head) in list_splice_tail_init() argument
320 __list_splice(list, head->prev, head); in list_splice_tail_init()
391 #define list_for_each(pos, head) \ argument
392 for (pos = (head)->next; !list_is_head(pos, (head)); pos = pos->next)
399 #define list_for_each_prev(pos, head) \ argument
400 for (pos = (head)->prev; !list_is_head(pos, (head)); pos = pos->prev)
408 #define list_for_each_safe(pos, n, head) \ argument
409 for (pos = (head)->next, n = pos->next; pos != (head); \
418 #define list_for_each_prev_safe(pos, n, head) \ argument
419 for (pos = (head)->prev, n = pos->prev; \
420 !list_is_head(pos, (head)); \
429 #define list_entry_is_head(pos, head, member) \ argument
430 list_is_head(&pos->member, (head))
438 #define list_for_each_entry(pos, head, member) \ argument
439 for (pos = list_first_entry(head, typeof(*pos), member); \
440 !list_entry_is_head(pos, head, member); \
449 #define list_for_each_entry_reverse(pos, head, member) \ argument
450 for (pos = list_last_entry(head, typeof(*pos), member); \
451 !list_entry_is_head(pos, head, member); \
462 #define list_prepare_entry(pos, head, member) \ argument
463 ((pos) ? : list_entry(head, typeof(*pos), member))
474 #define list_for_each_entry_continue(pos, head, member) \ argument
476 !list_entry_is_head(pos, head, member); \
488 #define list_for_each_entry_continue_reverse(pos, head, member) \ argument
490 !list_entry_is_head(pos, head, member); \
501 #define list_for_each_entry_from(pos, head, member) \ argument
502 for (; !list_entry_is_head(pos, head, member); \
512 #define list_for_each_entry_safe(pos, n, head, member) \ argument
513 for (pos = list_entry((head)->next, typeof(*pos), member), \
515 &pos->member != (head); \
528 #define list_for_each_entry_safe_continue(pos, n, head, member) \ argument
531 &pos->member != (head); \
544 #define list_for_each_entry_safe_from(pos, n, head, member) \ argument
546 &pos->member != (head); \
559 #define list_for_each_entry_safe_reverse(pos, n, head, member) \ argument
560 for (pos = list_entry((head)->prev, typeof(*pos), member), \
562 &pos->member != (head); \
569 static inline size_t list_count_nodes(struct list_head *head) in list_count_nodes() argument
574 list_for_each(pos, head) in list_count_nodes()
671 #define hlist_for_each(pos, head) \ argument
672 for (pos = (head)->first; pos ; pos = pos->next)
674 #define hlist_for_each_safe(pos, n, head) \ argument
675 for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \
689 #define hlist_for_each_entry(pos, head, member) \ argument
690 for (pos = hlist_entry_safe((head)->first, typeof(*(pos)), member);\
720 #define hlist_for_each_entry_safe(pos, n, head, member) \ argument
721 for (pos = hlist_entry_safe((head)->first, typeof(*pos), member);\