feat: rename(2), mount(2) and unmount(2)
[lunaix-os.git] / lunaix-os / includes / lunaix / ds / llist.h
index 9af9dd1fba4ebe90fe86090e3e72438492cea95e..22e0f931b3e22fb9cad6c29963dc6f8b18b958ca 100644 (file)
@@ -41,13 +41,13 @@ llist_init_head(struct llist_header* head)
 static inline void
 llist_append(struct llist_header* head, struct llist_header* elem)
 {
-    __llist_add(elem, head, head->next);
+    __llist_add(elem, head->prev, head);
 }
 
 static inline void
 llist_prepend(struct llist_header* head, struct llist_header* elem)
 {
-    __llist_add(elem, head->prev, head);
+    __llist_add(elem, head, head->next);
 }
 
 static inline void
@@ -93,8 +93,10 @@ struct hlist_node
 };
 
 static inline void
-hlist_del(struct hlist_node* node)
+hlist_delete(struct hlist_node* node)
 {
+    if (!node->pprev)
+        return;
     *node->pprev = node->next;
     node->next = 0;
     node->pprev = 0;