list.h 866 B

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