ldb: removing unnecessary module pointer
authorAaron Haslett <aaronhaslett@catalyst.net.nz>
Wed, 15 May 2019 22:53:38 +0000 (10:53 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 22 May 2019 04:42:29 +0000 (04:42 +0000)
We want to reuse the reindex context struct for repacking, but it has an
unnecessary module pointer on it. Turns out the existing code doesn't
need it either, so this patch deletes the pointer.

Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
lib/ldb/ldb_key_value/ldb_kv.h
lib/ldb/ldb_key_value/ldb_kv_index.c
lib/ldb/ldb_tdb/ldb_tdb.c

index c9e55321d0d612961a82cdc283171f67afaf72d0..1186e86ec9f3e140857ebedaa6b96ca85ae1ac9d 100644 (file)
@@ -137,7 +137,6 @@ struct ldb_kv_context {
 };
 
 struct ldb_kv_reindex_context {
-       struct ldb_module *module;
        int error;
        uint32_t count;
 };
index e1ca1cd243674c209beaa382ce4e16f55bf28774..f6b2620a87519bbdd20eed48c2269e6155e4ff5b 100644 (file)
@@ -3268,7 +3268,7 @@ static int re_key(struct ldb_kv_private *ldb_kv,
        struct ldb_context *ldb;
        struct ldb_kv_reindex_context *ctx =
            (struct ldb_kv_reindex_context *)state;
-       struct ldb_module *module = ctx->module;
+       struct ldb_module *module = ldb_kv->module;
        struct ldb_message *msg;
        int ret;
        struct ldb_val key2;
@@ -3346,7 +3346,7 @@ static int re_index(struct ldb_kv_private *ldb_kv,
        struct ldb_context *ldb;
        struct ldb_kv_reindex_context *ctx =
            (struct ldb_kv_reindex_context *)state;
-       struct ldb_module *module = ctx->module;
+       struct ldb_module *module = ldb_kv->module;
        struct ldb_message *msg;
        int ret;
        bool is_record;
@@ -3466,7 +3466,6 @@ int ldb_kv_reindex(struct ldb_module *module)
                return LDB_ERR_OPERATIONS_ERROR;
        }
 
-       ctx.module = module;
        ctx.error = 0;
        ctx.count = 0;
 
index ae0001e80840c2f6df9d773b107b05138bbe00b5..2f0468fd40a29db36b99284a8964a8d0b55ebc63 100644 (file)
@@ -286,7 +286,7 @@ static int ltdb_update_in_iterate(struct ldb_kv_private *ldb_kv,
        struct ldb_context *ldb;
        struct ldb_kv_reindex_context *ctx =
            (struct ldb_kv_reindex_context *)state;
-       struct ldb_module *module = ctx->module;
+       struct ldb_module *module = ldb_kv->module;
        TDB_DATA key = {
                .dptr = ldb_key.data,
                .dsize = ldb_key.length