Lines Matching refs:head

82  * @head: list head to add it after
84 * Insert a new entry after the specified head.
87 static inline void list_add(struct list_head *new, struct list_head *head)
89 __list_add(new, head, head->next);
95 * @head: list head to add it before
97 * Insert a new entry before the specified head.
100 static inline void list_add_tail(struct list_head *new, struct list_head *head)
102 __list_add(new, head->prev, head);
168 * list_move - delete from one list and add as another's head
170 * @head: the head that will precede our entry
172 static inline void list_move(struct list_head *list, struct list_head *head)
175 list_add(list, head);
181 * @head: the head that will follow our entry
184 struct list_head *head)
187 list_add_tail(list, head);
191 * list_is_last - tests whether @list is the last entry in list @head
193 * @head: the head of the list
196 const struct list_head *head)
198 return list->next == head;
203 * @head: the list to test.
205 static inline int list_empty(const struct list_head *head)
207 return head->next == head;
212 * @head: the list to test
223 static inline int list_empty_careful(const struct list_head *head)
225 struct list_head *next = head->next;
226 return (next == head) && (next == head->prev);
231 * @head: the list to test.
233 static inline int list_is_singular(const struct list_head *head)
235 return !list_empty(head) && (head->next == head->prev);
239 struct list_head *head,
243 list->next = head->next;
247 head->next = new_first;
248 new_first->prev = head;
254 * @head: a list with entries
255 * @entry: an entry within head, could be the head itself
258 * This helper moves the initial part of @head, up to and
259 * including @entry, from @head to @list. You should
260 * pass on @entry an element you know is on @head. @list
266 struct list_head *head,
269 if (list_empty(head))
271 if (list_is_singular(head) && (head->next != entry && head != entry))
273 if (entry == head)
276 __list_cut_position(list, head, entry);
295 * @head: the place to add it in the first list.
298 struct list_head *head)
301 __list_splice(list, head, head->next);
307 * @head: the place to add it in the first list.
310 struct list_head *head)
313 __list_splice(list, head->prev, head);
319 * @head: the place to add it in the first list.
324 struct list_head *head)
327 __list_splice(list, head, head->next);
335 * @head: the place to add it in the first list.
341 struct list_head *head)
344 __list_splice(list, head->prev, head);
360 * @ptr: the list head to take the element from.
372 * @head: the head for your list.
374 #define list_for_each(pos, head) \
375 for (pos = (head)->next; prefetch(pos->next), pos != (head); \
381 * @head: the head for your list.
388 #define __list_for_each(pos, head) \
389 for (pos = (head)->next; pos != (head); pos = pos->next)
394 * @head: the head for your list.
396 #define list_for_each_prev(pos, head) \
397 for (pos = (head)->prev; prefetch(pos->prev), pos != (head); \
404 * @head: the head for your list.
406 #define list_for_each_safe(pos, n, head) \
407 for (pos = (head)->next, n = pos->next; pos != (head); \
414 * @head: the head for your list.
416 #define list_for_each_prev_safe(pos, n, head) \
417 for (pos = (head)->prev, n = pos->prev; \
418 prefetch(pos->prev), pos != (head); \
424 * @head: the head for your list.
427 #define list_for_each_entry(pos, head, member) \
428 for (pos = list_entry((head)->next, typeof(*pos), member); \
429 &pos->member != (head); \
435 * @head: the head for your list.
438 #define list_for_each_entry_reverse(pos, head, member) \
439 for (pos = list_entry((head)->prev, typeof(*pos), member); \
440 prefetch(pos->member.prev), &pos->member != (head); \
446 * @head: the head of the list
451 #define list_prepare_entry(pos, head, member) \
452 ((pos) ? : list_entry(head, typeof(*pos), member))
457 * @head: the head for your list.
463 #define list_for_each_entry_continue(pos, head, member) \
465 prefetch(pos->member.next), &pos->member != (head); \
471 * @head: the head for your list.
477 #define list_for_each_entry_continue_reverse(pos, head, member) \
479 prefetch(pos->member.prev), &pos->member != (head); \
485 * @head: the head for your list.
490 #define list_for_each_entry_from(pos, head, member) \
491 for (; prefetch(pos->member.next), &pos->member != (head); \
498 * @head: the head for your list.
501 #define list_for_each_entry_safe(pos, n, head, member) \
502 for (pos = list_entry((head)->next, typeof(*pos), member), \
504 &pos->member != (head); \
511 * @head: the head for your list.
517 #define list_for_each_entry_safe_continue(pos, n, head, member) \
520 &pos->member != (head); \
527 * @head: the head for your list.
533 #define list_for_each_entry_safe_from(pos, n, head, member) \
535 &pos->member != (head); \
542 * @head: the head for your list.
548 #define list_for_each_entry_safe_reverse(pos, n, head, member) \
549 for (pos = list_entry((head)->prev, typeof(*pos), member), \
551 &pos->member != (head); \