__list_del(entry->prev, entry->next);
}
+/**
+ * list_del_init - deletes entry from list and reinitialize it.
+ * @entry: the element to delete from the list.
+ */
+static inline void list_del_init(struct list_head *entry)
+{
+ list_del(entry);
+ INIT_LIST_HEAD(entry);
+}
+
/**
* list_empty - tests whether a list is empty
* @head: the list to test.
h->pprev = NULL;
}
-static inline void hlist_del(struct hlist_node *n)
+static inline int hlist_unhashed(const struct hlist_node *h)
+{
+ return !h->pprev;
+}
+
+static inline int hlist_empty(const struct hlist_head *h)
+{
+ return !h->first;
+}
+
+static inline void __hlist_del(struct hlist_node *n)
{
struct hlist_node *next = n->next;
struct hlist_node **pprev = n->pprev;
next->pprev = pprev;
}
+static inline void hlist_del(struct hlist_node *n)
+{
+ __hlist_del(n);
+#if 0
+ n->next = LIST_POISON1;
+ n->pprev = LIST_POISON2;
+#endif
+}
+
+static inline void hlist_del_init(struct hlist_node *n)
+{
+ if (!hlist_unhashed(n)) {
+ __hlist_del(n);
+ INIT_HLIST_NODE(n);
+ }
+}
+
static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h)
{
struct hlist_node *first = h->first;