]> err.no Git - linux-2.6/blobdiff - include/linux/list.h
[PATCH] libata-hp-prep: add prereset() method and implement ata_std_prereset()
[linux-2.6] / include / linux / list.h
index beb6e48e116ff5e0cef22f2109ace0d5335bc63d..76f05718342c95e3abd89f0131aeeebeffe17a36 100644 (file)
@@ -410,6 +410,17 @@ static inline void list_splice_init(struct list_head *list,
             prefetch(pos->member.next), &pos->member != (head);        \
             pos = list_entry(pos->member.next, typeof(*pos), member))
 
+/**
+ * list_for_each_entry_from -  iterate over list of given type
+ *                     continuing from existing point
+ * @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_from(pos, head, member)                    \
+       for (; prefetch(pos->member.next), &pos->member != (head);      \
+            pos = list_entry(pos->member.next, typeof(*pos), member))
+
 /**
  * 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.
@@ -608,7 +619,7 @@ static inline void hlist_del_rcu(struct hlist_node *n)
 
 static inline void hlist_del_init(struct hlist_node *n)
 {
-       if (n->pprev)  {
+       if (!hlist_unhashed(n)) {
                __hlist_del(n);
                INIT_HLIST_NODE(n);
        }