Whamcloud - gitweb
* ranal passes netregression
[fs/lustre-release.git] / lnet / include / lnet / list.h
index 2b63312..37d9952 100644 (file)
@@ -1,7 +1,4 @@
 #ifndef _LINUX_LIST_H
-#define _LINUX_LIST_H
-
-
 /*
  * Simple doubly linked list implementation.
  *
  * using the generic single-entry routines.
  */
 
-#define prefetch(a) ((void)a)
-
 struct list_head {
        struct list_head *next, *prev;
 };
 
+typedef struct list_head list_t;
+
 #define LIST_HEAD_INIT(name) { &(name), &(name) }
 
 #define LIST_HEAD(name) \
@@ -101,7 +98,9 @@ static inline void list_del_init(struct list_head *entry)
        __list_del(entry->prev, entry->next);
        INIT_LIST_HEAD(entry);
 }
+#endif
 
+#ifndef list_for_each_entry
 /**
  * list_move - delete from one list and add as another's head
  * @list: the entry to move
@@ -124,7 +123,10 @@ static inline void list_move_tail(struct list_head *list,
        __list_del(list->prev, list->next);
        list_add_tail(list, head);
 }
+#endif
 
+#ifndef _LINUX_LIST_H
+#define _LINUX_LIST_H
 /**
  * list_empty - tests whether a list is empty
  * @head: the list to test.
@@ -190,8 +192,7 @@ static inline void list_splice_init(struct list_head *list,
  * @head:      the head for your list.
  */
 #define list_for_each(pos, head) \
-       for (pos = (head)->next, prefetch(pos->next); pos != (head); \
-               pos = pos->next, prefetch(pos->next))
+       for (pos = (head)->next ; pos != (head); pos = pos->next )
 
 /**
  * list_for_each_prev  -       iterate over a list in reverse order
@@ -199,8 +200,7 @@ static inline void list_splice_init(struct list_head *list,
  * @head:      the head for your list.
  */
 #define list_for_each_prev(pos, head) \
-       for (pos = (head)->prev, prefetch(pos->prev); pos != (head); \
-               pos = pos->prev, prefetch(pos->prev))
+       for (pos = (head)->prev ; pos != (head); pos = pos->prev)
 
 /**
  * list_for_each_safe  -       iterate over a list safe against removal of list entry
@@ -222,11 +222,9 @@ static inline void list_splice_init(struct list_head *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);                        \
+        for (pos = list_entry((head)->next, typeof(*pos), member);     \
             &pos->member != (head);                                    \
-            pos = list_entry(pos->member.next, typeof(*pos), member),  \
-            prefetch(pos->member.next))
+            pos = list_entry(pos->member.next, typeof(*pos), member))
 #endif
 
 #ifndef list_for_each_entry_safe