Lines Matching refs:pos
358 * @pos: the &struct list_head to use as a loop cursor.
361 #define list_for_each(pos, head) \
362 for (pos = (head)->next; prefetch(pos->next), pos != (head); \
363 pos = pos->next)
367 * @pos: the &struct list_head to use as a loop cursor.
375 #define __list_for_each(pos, head) \
376 for (pos = (head)->next; pos != (head); pos = pos->next)
380 * @pos: the &struct list_head to use as a loop cursor.
383 #define list_for_each_prev(pos, head) \
384 for (pos = (head)->prev; prefetch(pos->prev), pos != (head); \
385 pos = pos->prev)
389 * @pos: the &struct list_head to use as a loop cursor.
393 #define list_for_each_safe(pos, n, head) \
394 for (pos = (head)->next, n = pos->next; pos != (head); \
395 pos = n, n = pos->next)
399 * @pos: the type * to use as a loop cursor.
403 #define list_for_each_entry(pos, head, member) \
404 for (pos = list_entry((head)->next, typeof(*pos), member); \
405 prefetch(pos->member.next), &pos->member != (head); \
406 pos = list_entry(pos->member.next, typeof(*pos), member))
410 * @pos: the type * to use as a loop cursor.
414 #define list_for_each_entry_reverse(pos, head, member) \
415 for (pos = list_entry((head)->prev, typeof(*pos), member); \
416 prefetch(pos->member.prev), &pos->member != (head); \
417 pos = list_entry(pos->member.prev, typeof(*pos), member))
420 * list_prepare_entry - prepare a pos entry for use in list_for_each_entry_continue
421 * @pos: the type * to use as a start point
425 * Prepares a pos entry for use as a start point in list_for_each_entry_continue.
427 #define list_prepare_entry(pos, head, member) \
428 ((pos) ? : list_entry(head, typeof(*pos), member))
432 * @pos: the type * to use as a loop cursor.
439 #define list_for_each_entry_continue(pos, head, member) \
440 for (pos = list_entry(pos->member.next, typeof(*pos), member); \
441 prefetch(pos->member.next), &pos->member != (head); \
442 pos = list_entry(pos->member.next, typeof(*pos), member))
446 * @pos: the type * to use as a loop cursor.
452 #define list_for_each_entry_from(pos, head, member) \
453 for (; prefetch(pos->member.next), &pos->member != (head); \
454 pos = list_entry(pos->member.next, typeof(*pos), member))
458 * @pos: the type * to use as a loop cursor.
463 #define list_for_each_entry_safe(pos, n, head, member) \
464 for (pos = list_entry((head)->next, typeof(*pos), member), \
465 n = list_entry(pos->member.next, typeof(*pos), member); \
466 &pos->member != (head); \
467 pos = n, n = list_entry(n->member.next, typeof(*n), member))
471 * @pos: the type * to use as a loop cursor.
479 #define list_for_each_entry_safe_continue(pos, n, head, member) \
480 for (pos = list_entry(pos->member.next, typeof(*pos), member), \
481 n = list_entry(pos->member.next, typeof(*pos), member); \
482 &pos->member != (head); \
483 pos = n, n = list_entry(n->member.next, typeof(*n), member))
487 * @pos: the type * to use as a loop cursor.
495 #define list_for_each_entry_safe_from(pos, n, head, member) \
496 for (n = list_entry(pos->member.next, typeof(*pos), member); \
497 &pos->member != (head); \
498 pos = n, n = list_entry(n->member.next, typeof(*n), member))
502 * @pos: the type * to use as a loop cursor.
510 #define list_for_each_entry_safe_reverse(pos, n, head, member) \
511 for (pos = list_entry((head)->prev, typeof(*pos), member), \
512 n = list_entry(pos->member.prev, typeof(*pos), member); \
513 &pos->member != (head); \
514 pos = n, n = list_entry(n->member.prev, typeof(*n), member))
518 * @pos: the &struct list_head to use as a loop cursor.
525 #define list_for_each_rcu(pos, head) \
526 for (pos = (head)->next; \
527 prefetch(rcu_dereference(pos)->next), pos != (head); \
528 pos = pos->next)
530 #define __list_for_each_rcu(pos, head) \
531 for (pos = (head)->next; \
532 rcu_dereference(pos) != (head); \
533 pos = pos->next)
537 * @pos: the &struct list_head to use as a loop cursor.
547 #define list_for_each_safe_rcu(pos, n, head) \
548 for (pos = (head)->next; \
549 n = rcu_dereference(pos)->next, pos != (head); \
550 pos = n)
554 * @pos: the type * to use as a loop cursor.
562 #define list_for_each_entry_rcu(pos, head, member) \
563 for (pos = list_entry((head)->next, typeof(*pos), member); \
564 prefetch(rcu_dereference(pos)->member.next), \
565 &pos->member != (head); \
566 pos = list_entry(pos->member.next, typeof(*pos), member))
571 * @pos: the &struct list_head to use as a loop cursor.
580 #define list_for_each_continue_rcu(pos, head) \
581 for ((pos) = (pos)->next; \
582 prefetch(rcu_dereference((pos))->next), (pos) != (head); \
583 (pos) = (pos)->next)
811 #define hlist_for_each(pos, head) \
812 for (pos = (head)->first; pos && ({ prefetch(pos->next); 1; }); \
813 pos = pos->next)
815 #define hlist_for_each_safe(pos, n, head) \
816 for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \
817 pos = n)
822 * @pos: the &struct hlist_node to use as a loop cursor.
826 #define hlist_for_each_entry(tpos, pos, head, member) \
827 for (pos = (head)->first; \
828 pos && ({ prefetch(pos->next); 1;}) && \
829 ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
830 pos = pos->next)
835 * @pos: the &struct hlist_node to use as a loop cursor.
838 #define hlist_for_each_entry_continue(tpos, pos, member) \
839 for (pos = (pos)->next; \
840 pos && ({ prefetch(pos->next); 1;}) && \
841 ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
842 pos = pos->next)
847 * @pos: the &struct hlist_node to use as a loop cursor.
850 #define hlist_for_each_entry_from(tpos, pos, member) \
851 for (; pos && ({ prefetch(pos->next); 1;}) && \
852 ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
853 pos = pos->next)
858 * @pos: the &struct hlist_node to use as a loop cursor.
863 #define hlist_for_each_entry_safe(tpos, pos, n, head, member) \
864 for (pos = (head)->first; \
865 pos && ({ n = pos->next; 1; }) && \
866 ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
867 pos = n)
872 * @pos: the &struct hlist_node to use as a loop cursor.
880 #define hlist_for_each_entry_rcu(tpos, pos, head, member) \
881 for (pos = (head)->first; \
882 rcu_dereference(pos) && ({ prefetch(pos->next); 1;}) && \
883 ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
884 pos = pos->next)