list.h 874 B

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