Lines Matching refs:head

85  * @head: list head to add it after
87 * Insert a new entry after the specified head.
90 static inline void list_add(struct list_head *new, struct list_head *head)
92 __list_add(new, head, head->next);
98 * @head: list head to add it before
100 * Insert a new entry before the specified head.
103 static inline void list_add_tail(struct list_head *new, struct list_head *head)
105 __list_add(new, head->prev, head);
127 * @head: list head to add it after
129 * Insert a new entry after the specified head.
140 static inline void list_add_rcu(struct list_head *new, struct list_head *head)
142 __list_add_rcu(new, head, head->next);
148 * @head: list head to add it before
150 * Insert a new entry before the specified head.
162 struct list_head *head)
164 __list_add_rcu(new, head->prev, head);
234 * list_move - delete from one list and add as another's head
236 * @head: the head that will precede our entry
238 static inline void list_move(struct list_head *list, struct list_head *head)
241 list_add(list, head);
247 * @head: the head that will follow our entry
250 struct list_head *head)
253 list_add_tail(list, head);
258 * @head: the list to test.
260 static inline int list_empty(const struct list_head *head)
262 return head->next == head;
275 * @head: the list to test.
277 static inline int list_empty_careful(const struct list_head *head)
279 struct list_head *next = head->next;
280 return (next == head) && (next == head->prev);
284 struct list_head *head)
288 struct list_head *at = head->next;
290 first->prev = head;
291 head->next = first;
300 * @head: the place to add it in the first list.
302 static inline void list_splice(struct list_head *list, struct list_head *head)
305 __list_splice(list, head);
311 * @head: the place to add it in the first list.
316 struct list_head *head)
319 __list_splice(list, head);
336 * @head: the head for your list.
338 #define list_for_each(pos, head) \
339 for (pos = (head)->next, prefetch(pos->next); pos != (head); \
345 * @head: the head for your list.
352 #define __list_for_each(pos, head) \
353 for (pos = (head)->next; pos != (head); pos = pos->next)
358 * @head: the head for your list.
360 #define list_for_each_prev(pos, head) \
361 for (pos = (head)->prev, prefetch(pos->prev); pos != (head); \
368 * @head: the head for your list.
370 #define list_for_each_safe(pos, n, head) \
371 for (pos = (head)->next, n = pos->next; pos != (head); \
377 * @head: the head for your list.
380 #define list_for_each_entry(pos, head, member) \
381 for (pos = list_entry((head)->next, typeof(*pos), member), \
383 &pos->member != (head); \
390 * @head: the head for your list.
393 #define list_for_each_entry_reverse(pos, head, member) \
394 for (pos = list_entry((head)->prev, typeof(*pos), member), \
396 &pos->member != (head); \
404 * @head: the head of the list
407 #define list_prepare_entry(pos, head, member) \
408 ((pos) ? : list_entry(head, typeof(*pos), member))
414 * @head: the head for your list.
417 #define list_for_each_entry_continue(pos, head, member) \
420 &pos->member != (head); \
428 * @head: the head for your list.
431 #define list_for_each_entry_safe(pos, n, head, member) \
432 for (pos = list_entry((head)->next, typeof(*pos), member), \
434 &pos->member != (head); \
440 * @head: the head for your list.
446 #define list_for_each_rcu(pos, head) \
447 for (pos = (head)->next, prefetch(pos->next); pos != (head); \
450 #define __list_for_each_rcu(pos, head) \
451 for (pos = (head)->next; pos != (head); \
459 * @head: the head for your list.
465 #define list_for_each_safe_rcu(pos, n, head) \
466 for (pos = (head)->next, n = pos->next; pos != (head); \
472 * @head: the head for your list.
479 #define list_for_each_entry_rcu(pos, head, member) \
480 for (pos = list_entry((head)->next, typeof(*pos), member), \
482 &pos->member != (head); \
492 * @head: the head for your list.
498 #define list_for_each_continue_rcu(pos, head) \
499 for ((pos) = (pos)->next, prefetch((pos)->next); (pos) != (head); \
503 * Double linked lists with a single pointer list head.
504 * Mostly useful for hash tables where the two pointer list head is
648 #define hlist_for_each(pos, head) \
649 for (pos = (head)->first; pos && ({ prefetch(pos->next); 1; }); \
652 #define hlist_for_each_safe(pos, n, head) \
653 for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \
660 * @head: the head for your list.
663 #define hlist_for_each_entry(tpos, pos, head, member) \
664 for (pos = (head)->first; \
697 * @head: the head for your list.
700 #define hlist_for_each_entry_safe(tpos, pos, n, head, member) \
701 for (pos = (head)->first; \
710 * @head: the head for your list.
717 #define hlist_for_each_entry_rcu(tpos, pos, head, member) \
718 for (pos = (head)->first; \