Whamcloud - gitweb
land b1_5 onto HEAD
[fs/lustre-release.git] / lustre / kernel_patches / patches / listman-2.4.21-chaos.patch
diff --git a/lustre/kernel_patches/patches/listman-2.4.21-chaos.patch b/lustre/kernel_patches/patches/listman-2.4.21-chaos.patch
new file mode 100644 (file)
index 0000000..6c85e49
--- /dev/null
@@ -0,0 +1,26 @@
+Index: linux-2.4.21-chaos/include/linux/list.h
+===================================================================
+--- linux-2.4.21-chaos.orig/include/linux/list.h       2003-12-05 16:54:33.000000000 +0300
++++ linux-2.4.21-chaos/include/linux/list.h    2003-12-12 16:08:20.000000000 +0300
+@@ -241,6 +241,21 @@
+            pos = list_entry(pos->member.next, typeof(*pos), member),  \
+                    prefetch(pos->member.next))
++#ifndef list_for_each_entry_safe
++/**
++ * list_for_each_entry_safe  -       iterate over list of given type safe against removal of list entry
++ * @pos:        the type * to use as a loop counter.
++ * @n:          another type * to use as temporary storage
++ * @head:       the head for your list.
++ * @member:     the name of the list_struct within the struct.
++ */
++#define list_for_each_entry_safe(pos, n, head, member)                        \
++        for (pos = list_entry((head)->next, typeof(*pos), member),    \
++              n = list_entry(pos->member.next, typeof(*pos), member); \
++           &pos->member != (head);                                    \
++           pos = n, n = list_entry(n->member.next, typeof(*n), member))
++#endif
++
+ #define list_first(head)      (((head)->next != (head)) ? (head)->next: (struct list_head *) 0)
+ #endif /* __KERNEL__ || _LVM_H_INCLUDE */