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()
69 * @head: list head to add it before
71 * Insert a new entry before the specified head.
74 static inline void list_add_tail(struct list_head *new, struct list_head *head) in list_add_tail() argument
76 __list_add(new, head->prev, head); in list_add_tail()
139 * list_move - delete from one list and add as another's head
141 * @head: the head that will precede our entry
143 static inline void list_move(struct list_head *list, struct list_head *head) in list_move() argument
146 list_add(list, head); in list_move()
152 * @head: the head that will follow our entry
155 struct list_head *head) in list_move_tail() argument
158 list_add_tail(list, head); in list_move_tail()
162 * list_is_last - tests whether @list is the last entry in list @head
164 * @head: the head of the list
167 const struct list_head *head) in list_is_last() argument
169 return list->next == head; in list_is_last()
174 * @head: the list to test.
176 static inline int list_empty(const struct list_head *head) in list_empty() argument
178 return head->next == head; in list_empty()
183 * @head: the list to test
194 static inline int list_empty_careful(const struct list_head *head) in list_empty_careful() argument
196 struct list_head *next = head->next; in list_empty_careful()
197 return (next == head) && (next == head->prev); in list_empty_careful()
202 * @head: the list to test.
204 static inline int list_is_singular(const struct list_head *head) in list_is_singular() argument
206 return !list_empty(head) && (head->next == head->prev); in list_is_singular()
210 struct list_head *head, struct list_head *entry) in __list_cut_position() argument
213 list->next = head->next; in __list_cut_position()
217 head->next = new_first; in __list_cut_position()
218 new_first->prev = head; in __list_cut_position()
224 * @head: a list with entries
225 * @entry: an entry within head, could be the head itself
228 * This helper moves the initial part of @head, up to and
229 * including @entry, from @head to @list. You should
230 * pass on @entry an element you know is on @head. @list
236 struct list_head *head, struct list_head *entry) in list_cut_position() argument
238 if (list_empty(head)) in list_cut_position()
240 if (list_is_singular(head) && in list_cut_position()
241 (head->next != entry && head != entry)) in list_cut_position()
243 if (entry == head) in list_cut_position()
246 __list_cut_position(list, head, entry); in list_cut_position()
266 * @head: the place to add it in the first list.
269 struct list_head *head) in list_splice() argument
272 __list_splice(list, head, head->next); in list_splice()
278 * @head: the place to add it in the first list.
281 struct list_head *head) in list_splice_tail() argument
284 __list_splice(list, head->prev, head); in list_splice_tail()
290 * @head: the place to add it in the first list.
295 struct list_head *head) in list_splice_init() argument
298 __list_splice(list, head, head->next); in list_splice_init()
306 * @head: the place to add it in the first list.
312 struct list_head *head) in list_splice_tail_init() argument
315 __list_splice(list, head->prev, head); in list_splice_tail_init()
331 * @ptr: the list head to take the element from.
342 * @ptr: the list head to take the element from.
354 * @head: the head for your list.
356 #define list_for_each(pos, head) \ argument
357 for (pos = (head)->next; prefetch(pos->next), pos != (head); \
363 * @head: the head for your list.
370 #define __list_for_each(pos, head) \ argument
371 for (pos = (head)->next; pos != (head); pos = pos->next)
376 * @head: the head for your list.
378 #define list_for_each_prev(pos, head) \ argument
379 for (pos = (head)->prev; prefetch(pos->prev), pos != (head); \
386 * @head: the head for your list.
388 #define list_for_each_safe(pos, n, head) \ argument
389 for (pos = (head)->next, n = pos->next; pos != (head); \
396 * @head: the head for your list.
398 #define list_for_each_prev_safe(pos, n, head) \ argument
399 for (pos = (head)->prev, n = pos->prev; \
400 prefetch(pos->prev), pos != (head); \
406 * @head: the head for your list.
409 #define list_for_each_entry(pos, head, member) \ argument
410 for (pos = list_entry((head)->next, typeof(*pos), member); \
411 prefetch(pos->member.next), &pos->member != (head); \
417 * @head: the head for your list.
420 #define list_for_each_entry_reverse(pos, head, member) \ argument
421 for (pos = list_entry((head)->prev, typeof(*pos), member); \
422 prefetch(pos->member.prev), &pos->member != (head); \
428 * @head: the head of the list
433 #define list_prepare_entry(pos, head, member) \ argument
434 ((pos) ? : list_entry(head, typeof(*pos), member))
439 * @head: the head for your list.
445 #define list_for_each_entry_continue(pos, head, member) \ argument
447 prefetch(pos->member.next), &pos->member != (head); \
453 * @head: the head for your list.
459 #define list_for_each_entry_continue_reverse(pos, head, member) \ argument
461 prefetch(pos->member.prev), &pos->member != (head); \
467 * @head: the head for your list.
472 #define list_for_each_entry_from(pos, head, member) \ argument
473 for (; prefetch(pos->member.next), &pos->member != (head); \
480 * @head: the head for your list.
483 #define list_for_each_entry_safe(pos, n, head, member) \ argument
484 for (pos = list_entry((head)->next, typeof(*pos), member), \
486 &pos->member != (head); \
493 * @head: the head for your list.
499 #define list_for_each_entry_safe_continue(pos, n, head, member) \ argument
502 &pos->member != (head); \
509 * @head: the head for your list.
515 #define list_for_each_entry_safe_from(pos, n, head, member) \ argument
517 &pos->member != (head); \
524 * @head: the head for your list.
530 #define list_for_each_entry_safe_reverse(pos, n, head, member) \ argument
531 for (pos = list_entry((head)->prev, typeof(*pos), member), \
533 &pos->member != (head); \
537 * Double linked lists with a single pointer list head.
538 * Mostly useful for hash tables where the two pointer list head is
627 #define hlist_for_each(pos, head) \ argument
628 for (pos = (head)->first; pos && ({ prefetch(pos->next); 1; }); \
631 #define hlist_for_each_safe(pos, n, head) \ argument
632 for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \
639 * @head: the head for your list.
642 #define hlist_for_each_entry(tpos, pos, head, member) \ argument
643 for (pos = (head)->first; \
676 * @head: the head for your list.
679 #define hlist_for_each_entry_safe(tpos, pos, n, head, member) \ argument
680 for (pos = (head)->first; \