at v2.6.39 27 lines 866 B view raw
1#include <linux/kernel.h> 2#include "../../../../include/linux/list.h" 3 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 */ 13static 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/** 21 * list_for_each_from - iterate over a list from one of its nodes 22 * @pos: the &struct list_head to use as a loop cursor, from where to start 23 * @head: the head for your list. 24 */ 25#define list_for_each_from(pos, head) \ 26 for (; prefetch(pos->next), pos != (head); pos = pos->next) 27#endif