list.h 840 B

1234567891011121314151617181920212223242526
  1. #include "../../../../include/linux/list.h"
  2. #ifndef PERF_LIST_H
  3. #define PERF_LIST_H
  4. /**
  5. * list_del_range - deletes range of entries from list.
  6. * @begin: first element in the range to delete from the list.
  7. * @end: last element in the range to delete from the list.
  8. * Note: list_empty on the range of entries does not return true after this,
  9. * the entries is in an undefined state.
  10. */
  11. static inline void list_del_range(struct list_head *begin,
  12. struct list_head *end)
  13. {
  14. begin->prev->next = end->next;
  15. end->next->prev = begin->prev;
  16. }
  17. /**
  18. * list_for_each_from - iterate over a list from one of its nodes
  19. * @pos: the &struct list_head to use as a loop cursor, from where to start
  20. * @head: the head for your list.
  21. */
  22. #define list_for_each_from(pos, head) \
  23. for (; prefetch(pos->next), pos != (head); pos = pos->next)
  24. #endif