Fix: rcuja merge fixes
[userspace-rcu.git] / urcu / hlist.h
index 462f4937363fa0c137ae8603531ec23399ec7d10..f8624b1697406a05659f70706d72deacf5c65188 100644 (file)
@@ -43,6 +43,16 @@ void CDS_INIT_HLIST_HEAD(struct cds_hlist_head *ptr)
 #define cds_hlist_entry(ptr, type, member) \
        ((type *) ((char *) (ptr) - (unsigned long) (&((type *) 0)->member)))
 
+/* Get first entry from a list. Assumes the hlist is not empty. */
+#define cds_hlist_first_entry(ptr, type, member) \
+       cds_list_entry((ptr)->next, type, member)
+
+static inline
+int cds_hlist_empty(struct cds_hlist_head *head)
+{
+       return !head->next;
+}
+
 /* Add new element at the head of the list. */
 static inline
 void cds_hlist_add_head(struct cds_hlist_node *newp,
@@ -104,7 +114,7 @@ void cds_hlist_del(struct cds_hlist_node *elem)
                        : cds_hlist_entry((head)->next, __typeof__(*entry), member)); \
                (entry != NULL) && (e = (entry->member.next == NULL ? NULL \
                                        : cds_hlist_entry(entry->member.next, \
-                                               __typeof__(*entry), member), 1)); \
+                                               __typeof__(*entry), member)), 1); \
                entry = e)
 
 #endif /* _KCOMPAT_HLIST_H */
This page took 0.023739 seconds and 4 git commands to generate.