s3-ldb: update the old ldb in s3 to use new DLIST macros
[ira/wip.git] / source3 / lib / ldb / modules / paged_results.c
index 63f9ee67523101dd73995b37d0cd84fa7286d6a0..e16b7104131f8d9405622cb2b8d54fa20e8f2170 100644 (file)
@@ -78,17 +78,7 @@ int store_destructor(struct results_store *store);
 
 int store_destructor(struct results_store *store)
 {
-       if (store->prev) {
-               store->prev->next = store->next;
-       }
-       if (store->next) {
-               store->next->prev = store->prev;
-       }
-
-       if (store == store->priv->store) {
-               store->priv->store = NULL;
-       }
-
+       DLIST_REMOVE(store->priv->store, store);
        return 0;
 }
 
@@ -120,10 +110,7 @@ static struct results_store *new_store(struct private_data *priv)
        newr->controls = NULL;
 
        /* put this entry as first */
-       newr->prev = NULL;
-       newr->next = priv->store;
-       if (priv->store != NULL) priv->store->prev = newr;
-       priv->store = newr;
+       DLIST_ADD(priv->store, newr);
 
        talloc_set_destructor(newr, store_destructor);