]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - security/tomoyo/common.h
TOMOYO: Change list iterator.
[net-next-2.6.git] / security / tomoyo / common.h
index 1277724edae4a1a967805e367784071660b33639..cdc9ef56fd86d35fee83d1b554cad30aebe146c4 100644 (file)
@@ -1023,19 +1023,11 @@ static inline bool tomoyo_same_number_union
 /**
  * list_for_each_cookie - iterate over a list with cookie.
  * @pos:        the &struct list_head to use as a loop cursor.
- * @cookie:     the &struct list_head to use as a cookie.
  * @head:       the head for your list.
- *
- * Same with list_for_each_rcu() except that this primitive uses @cookie
- * so that we can continue iteration.
- * @cookie must be NULL when iteration starts, and @cookie will become
- * NULL when iteration finishes.
  */
-#define list_for_each_cookie(pos, cookie, head)                                \
-       for (({ if (!cookie)                                            \
-                                    cookie = head; }),                 \
-                    pos = rcu_dereference((cookie)->next);             \
-            prefetch(pos->next), pos != (head) || ((cookie) = NULL);   \
-            (cookie) = pos, pos = rcu_dereference(pos->next))
+#define list_for_each_cookie(pos, head)                                        \
+       if (!pos)                                                       \
+               pos =  srcu_dereference((head)->next, &tomoyo_ss);      \
+       for ( ; pos != (head); pos = srcu_dereference(pos->next, &tomoyo_ss))
 
 #endif /* !defined(_SECURITY_TOMOYO_COMMON_H) */