1 Index: linux-2.4.18-chaos/include/linux/list.h
2 ===================================================================
3 --- linux-2.4.18-chaos.orig/include/linux/list.h 2003-11-23 00:07:05.000000000 +0300
4 +++ linux-2.4.18-chaos/include/linux/list.h 2003-12-11 00:25:15.000000000 +0300
6 for (pos = (head)->prev, prefetch(pos->prev); pos != (head); \
7 pos = pos->prev, prefetch(pos->prev))
10 + * list_for_each_entry - iterate over list of given type
11 + * @pos: the type * to use as a loop counter.
12 + * @head: the head for your list.
13 + * @member: the name of the list_struct within the struct.
15 +#define list_for_each_entry(pos, head, member) \
16 + for (pos = list_entry((head)->next, typeof(*pos), member), \
17 + prefetch(pos->member.next); \
18 + &pos->member != (head); \
19 + pos = list_entry(pos->member.next, typeof(*pos), member), \
20 + prefetch(pos->member.next))
22 +#ifndef list_for_each_entry_safe
24 + * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
25 + * @pos: the type * to use as a loop counter.
26 + * @n: another type * to use as temporary storage
27 + * @head: the head for your list.
28 + * @member: the name of the list_struct within the struct.
30 +#define list_for_each_entry_safe(pos, n, head, member) \
31 + for (pos = list_entry((head)->next, typeof(*pos), member), \
32 + n = list_entry(pos->member.next, typeof(*pos), member); \
33 + &pos->member != (head); \
34 + pos = n, n = list_entry(n->member.next, typeof(*n), member))
38 + * list_move - delete from one list and add as another's head
39 + * @list: the entry to move
40 + * @head: the head that will precede our entry
42 +static inline void list_move(struct list_head *list, struct list_head *head)
44 + __list_del(list->prev, list->next);
45 + list_add(list, head);
49 + * list_move_tail - delete from one list and add as another's tail
50 + * @list: the entry to move
51 + * @head: the head that will follow our entry
53 +static inline void list_move_tail(struct list_head *list,
54 + struct list_head *head)
56 + __list_del(list->prev, list->next);
57 + list_add_tail(list, head);
60 +/* 2.5 uses hlists for some things, like the d_hash. we'll treat them
61 + * as 2.5 and let macros drop back.. */
62 +#define hlist_entry list_entry
63 +#define hlist_head list_head
64 +#define hlist_node list_head
65 +#define HLIST_HEAD LIST_HEAD
66 +#define INIT_HLIST_HEAD INIT_LIST_HEAD
67 +#define hlist_del_init list_del_init
68 +#define hlist_add_head list_add
69 +#define hlist_for_each_safe list_for_each_safe
71 #endif /* __KERNEL__ || _LVM_H_INCLUDE */