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.
389 * @ptr: the list head to take the element from.
417 * @head: the head for your list.
419 #define list_for_each(pos, head) \ argument
420 for (pos = (head)->next; pos != (head); pos = pos->next)
425 * @head: the head for your list.
427 #define list_for_each_prev(pos, head) \ argument
428 for (pos = (head)->prev; pos != (head); pos = pos->prev)
434 * @head: the head for your list.
436 #define list_for_each_safe(pos, n, head) \ argument
437 for (pos = (head)->next, n = pos->next; pos != (head); \
444 * @head: the head for your list.
446 #define list_for_each_prev_safe(pos, n, head) \ argument
447 for (pos = (head)->prev, n = pos->prev; \
448 pos != (head); \
454 * @head: the head for your list.
457 #define list_for_each_entry(pos, head, member) \ argument
458 for (pos = list_first_entry(head, typeof(*pos), member); \
459 &pos->member != (head); \
465 * @head: the head for your list.
468 #define list_for_each_entry_reverse(pos, head, member) \ argument
469 for (pos = list_last_entry(head, typeof(*pos), member); \
470 &pos->member != (head); \
476 * @head: the head of the list
481 #define list_prepare_entry(pos, head, member) \ argument
482 ((pos) ? : list_entry(head, typeof(*pos), member))
487 * @head: the head for your list.
493 #define list_for_each_entry_continue(pos, head, member) \ argument
495 &pos->member != (head); \
501 * @head: the head for your list.
507 #define list_for_each_entry_continue_reverse(pos, head, member) \ argument
509 &pos->member != (head); \
515 * @head: the head for your list.
520 #define list_for_each_entry_from(pos, head, member) \ argument
521 for (; &pos->member != (head); \
528 * @head: the head for your list.
531 #define list_for_each_entry_safe(pos, n, head, member) \ argument
532 for (pos = list_first_entry(head, typeof(*pos), member), \
534 &pos->member != (head); \
541 * @head: the head for your list.
547 #define list_for_each_entry_safe_continue(pos, n, head, member) \ argument
550 &pos->member != (head); \
557 * @head: the head for your list.
563 #define list_for_each_entry_safe_from(pos, n, head, member) \ argument
565 &pos->member != (head); \
572 * @head: the head for your list.
578 #define list_for_each_entry_safe_reverse(pos, n, head, member) \ argument
579 for (pos = list_last_entry(head, typeof(*pos), member), \
581 &pos->member != (head); \
600 * Double linked lists with a single pointer list head.
601 * Mostly useful for hash tables where the two pointer list head is
693 * Move a list from one list head to another. Fixup the pprev
707 #define hlist_for_each(pos, head) \ argument
708 for (pos = (head)->first; pos ; pos = pos->next)
710 #define hlist_for_each_safe(pos, n, head) \ argument
711 for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \
722 * @head: the head for your list.
725 #define hlist_for_each_entry(pos, head, member) \ argument
726 for (pos = hlist_entry_safe((head)->first, typeof(*(pos)), member);\
753 * @head: the head for your list.
756 #define hlist_for_each_entry_safe(pos, n, head, member) \ argument
757 for (pos = hlist_entry_safe((head)->first, typeof(*pos), member);\
778 * @head: the head for your list.
780 #define list_for_each_from(pos, head) \ argument
781 for (; pos != (head); pos = pos->next)