@@ -29,26 +29,55 @@ struct bfdev_skip_head {
2929 bfdev_list_head_t nodes [0 ];
3030};
3131
32+ /**
33+ * bfdev_skiplist_find - find a node in the skiplist.
34+ * @head: the skiplist head to find in.
35+ * @find: the find function for this skiplist.
36+ * @pdata: the private data for @find.
37+ */
38+ extern bfdev_skip_node_t *
39+ bfdev_skiplist_find (bfdev_skip_head_t * head , bfdev_find_t find , void * pdata );
40+
41+ /**
42+ * bfdev_skiplist_insert - insert a node into the skiplist.
43+ * @head: the skiplist head to insert into.
44+ * @key: the key for this skiplist.
45+ * @cmp: the compare function for this skiplist.
46+ * @pdata: the private data for @cmp.
47+ */
3248extern int
33- bfdev_skiplist_insert (bfdev_skip_head_t * head , void * key , bfdev_cmp_t cmp ,
34- void * pdata );
49+ bfdev_skiplist_insert (bfdev_skip_head_t * head , void * key ,
50+ bfdev_cmp_t cmp , void * pdata );
3551
36- extern void
52+ /**
53+ * bfdev_skiplist_delete - delete a node from the skiplist.
54+ * @head: the skiplist head to delete from.
55+ * @find: the find function for this skiplist.
56+ * @pdata: the private data for @find.
57+ */
58+ extern int
3759bfdev_skiplist_delete (bfdev_skip_head_t * head , bfdev_find_t find , void * pdata );
3860
39- extern bfdev_skip_node_t *
40- bfdev_skiplist_find (bfdev_skip_head_t * head , bfdev_find_t find , void * pdata );
41-
61+ /**
62+ * bfdev_skiplist_reset - reset all nodes in a skiplist.
63+ * @head: the skiplist head to reset.
64+ * @release: the function to release each node.
65+ * @pdata: the private data for @release.
66+ */
4267extern void
43- bfdev_skiplist_reset (bfdev_skip_head_t * head , bfdev_release_t release ,
44- void * pdata );
45-
68+ bfdev_skiplist_reset (bfdev_skip_head_t * head ,
69+ bfdev_release_t release , void * pdata );
70+ /**
71+ * bfdev_skiplist_create - create a skiplist header.
72+ * @alloc: the allocator for this skiplist.
73+ * @levels: the levels for this skiplist.
74+ */
4675extern bfdev_skip_head_t *
4776bfdev_skiplist_create (const bfdev_alloc_t * alloc , unsigned int levels );
4877
4978extern void
50- bfdev_skiplist_destroy (bfdev_skip_head_t * head , bfdev_release_t release ,
51- void * pdata );
79+ bfdev_skiplist_destroy (bfdev_skip_head_t * head ,
80+ bfdev_release_t release , void * pdata );
5281
5382/**
5483 * bfdev_skiplist_for_each - iterate over list of given type.
0 commit comments