Lines Matching full:head
56 * @head: list head to add it after
58 * Insert a new entry after the specified 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()
70 * @head: list head to add it before
72 * Insert a new entry before the specified head.
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()
150 * list_move - delete from one list and add as another's head
152 * @head: the head that will precede our entry
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()
163 * @head: the head that will follow our entry
166 struct list_head *head) in list_move_tail() argument
169 list_add_tail(list, head); in list_move_tail()
173 * list_is_last - tests whether @list is the last entry in list @head
175 * @head: the head of the list
178 const struct list_head *head) in list_is_last() argument
180 return list->next == head; in list_is_last()
185 * @head: the list to test.
187 static inline int list_empty(const struct list_head *head) in list_empty() argument
189 return head->next == head; in list_empty()
194 * @head: the list to test
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()
213 * @head: the head of the list
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()
227 * @head: the list to test.
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()
249 * @head: a list with entries
250 * @entry: an entry within head, could be the head itself
253 * This helper moves the initial part of @head, up to and
254 * including @entry, from @head to @list. You should
255 * pass on @entry an element you know is on @head. @list
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()
291 * @head: the place to add it in the first list.
294 struct list_head *head) in list_splice() argument
297 __list_splice(list, head, head->next); in list_splice()
303 * @head: the place to add it in the first list.
306 struct list_head *head) in list_splice_tail() argument
309 __list_splice(list, head->prev, head); in list_splice_tail()
315 * @head: the place to add it in the first list.
320 struct list_head *head) in list_splice_init() argument
323 __list_splice(list, head, head->next); in list_splice_init()
331 * @head: the place to add it in the first list.
337 struct list_head *head) in list_splice_tail_init() argument
340 __list_splice(list, head->prev, head); in list_splice_tail_init()
356 * @ptr: the list head to take the element from.
367 * @ptr: the list head to take the element from.
378 * @ptr: the list head to take the element from.
406 * @head: the head for your list.
408 #define list_for_each(pos, head) \ argument
409 for (pos = (head)->next; pos != (head); pos = pos->next)
414 * @head: the head for your list.
416 #define list_for_each_prev(pos, head) \ argument
417 for (pos = (head)->prev; pos != (head); pos = pos->prev)
423 * @head: the head for your list.
425 #define list_for_each_safe(pos, n, head) \ argument
426 for (pos = (head)->next, n = pos->next; pos != (head); \
433 * @head: the head for your list.
435 #define list_for_each_prev_safe(pos, n, head) \ argument
436 for (pos = (head)->prev, n = pos->prev; \
437 pos != (head); \
443 * @head: the head for your list.
446 #define list_for_each_entry(pos, head, member) \ argument
447 for (pos = list_first_entry(head, typeof(*pos), member); \
448 &pos->member != (head); \
454 * @head: the head for your list.
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); \
465 * @head: the head of the list
470 #define list_prepare_entry(pos, head, member) \ argument
471 ((pos) ? : list_entry(head, typeof(*pos), member))
476 * @head: the head for your list.
482 #define list_for_each_entry_continue(pos, head, member) \ argument
484 &pos->member != (head); \
490 * @head: the head for your list.
496 #define list_for_each_entry_continue_reverse(pos, head, member) \ argument
498 &pos->member != (head); \
504 * @head: the head for your list.
509 #define list_for_each_entry_from(pos, head, member) \ argument
510 for (; &pos->member != (head); \
517 * @head: the head for your list.
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); \
530 * @head: the head for your list.
536 #define list_for_each_entry_safe_continue(pos, n, head, member) \ argument
539 &pos->member != (head); \
546 * @head: the head for your list.
552 #define list_for_each_entry_safe_from(pos, n, head, member) \ argument
554 &pos->member != (head); \
561 * @head: the head for your list.
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); \
589 * Double linked lists with a single pointer list head.
590 * Mostly useful for hash tables where the two pointer list head is
682 * Move a list from one list head to another. Fixup the pprev
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; }); \
711 * @head: the head for your list.
714 #define hlist_for_each_entry(pos, head, member) \ argument
715 for (pos = hlist_entry_safe((head)->first, typeof(*(pos)), member);\
742 * @head: the head for your list.
745 #define hlist_for_each_entry_safe(pos, n, head, member) \ argument
746 for (pos = hlist_entry_safe((head)->first, typeof(*pos), member);\
767 * @head: the head for your list.
769 #define list_for_each_from(pos, head) \ argument
770 for (; pos != (head); pos = pos->next)