From d77406597f848849f75c596d9e1ca4fe74b6d94e Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 10 Dec 2003 19:10:15 +0000 Subject: [PATCH] - list_for_each_entry() added --- lustre/kernel_patches/patches/listman-2.4.18.patch | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/lustre/kernel_patches/patches/listman-2.4.18.patch b/lustre/kernel_patches/patches/listman-2.4.18.patch index 37535c09..3477257 100644 --- a/lustre/kernel_patches/patches/listman-2.4.18.patch +++ b/lustre/kernel_patches/patches/listman-2.4.18.patch @@ -1,11 +1,24 @@ Index: linux-2.4.18-chaos/include/linux/list.h =================================================================== ---- linux-2.4.18-chaos.orig/include/linux/list.h 2003-10-22 13:43:39.000000000 +0400 -+++ linux-2.4.18-chaos/include/linux/list.h 2003-10-22 13:44:17.000000000 +0400 -@@ -173,6 +173,16 @@ +--- linux-2.4.18-chaos.orig/include/linux/list.h 2003-11-23 00:07:05.000000000 +0300 ++++ linux-2.4.18-chaos/include/linux/list.h 2003-12-10 22:05:23.000000000 +0300 +@@ -173,6 +173,29 @@ for (pos = (head)->prev, prefetch(pos->prev); pos != (head); \ pos = pos->prev, prefetch(pos->prev)) ++/** ++ * list_for_each_entry - iterate over list of given type ++ * @pos: the type * to use as a loop counter. ++ * @head: the head for your list. ++ * @member: the name of the list_struct within the struct. ++ */ ++#define list_for_each_entry(pos, head, member) \ ++ for (pos = list_entry((head)->next, typeof(*pos), member), \ ++ prefetch(pos->member.next); \ ++ &pos->member != (head); \ ++ pos = list_entry(pos->member.next, typeof(*pos), member), \ ++ prefetch(pos->member.next)) ++ +/* 2.5 uses hlists for some things, like the d_hash. we'll treat them + * as 2.5 and let macros drop back.. */ +#define hlist_entry list_entry -- 1.8.3.1