lib ldb: rename ltdb_context to ldb_kv_context
authorGary Lockyer <gary@catalyst.net.nz>
Thu, 19 Jul 2018 21:07:47 +0000 (09:07 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 30 Jul 2018 12:31:53 +0000 (14:31 +0200)
Rename ltdb_context to ldb_kv_context as it is a key value level
structure and not tdb specific.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/ldb/ldb_tdb/ldb_index.c
lib/ldb/ldb_tdb/ldb_search.c
lib/ldb/ldb_tdb/ldb_tdb.c
lib/ldb/ldb_tdb/ldb_tdb.h

index 1399f6902debb238364f5264cb65f0a51736a311..a04431ef7b99cc231baf0492ac7d57fcd818ed08 100644 (file)
@@ -1734,7 +1734,7 @@ static int ldb_kv_index_dn(struct ldb_module *module,
 */
 static int ldb_kv_index_filter(struct ltdb_private *ltdb,
                               const struct dn_list *dn_list,
-                              struct ltdb_context *ac,
+                              struct ldb_kv_context *ac,
                               uint32_t *match_count,
                               enum key_truncation scope_one_truncation)
 {
@@ -1936,7 +1936,7 @@ static void ldb_kv_dn_list_sort(struct ltdb_private *ltdb, struct dn_list *list)
   returns -1 if an indexed search is not possible, in which
   case the caller should call ltdb_search_full()
 */
-int ldb_kv_search_indexed(struct ltdb_context *ac, uint32_t *match_count)
+int ldb_kv_search_indexed(struct ldb_kv_context *ac, uint32_t *match_count)
 {
        struct ldb_context *ldb = ldb_module_get_ctx(ac->module);
        struct ltdb_private *ltdb = talloc_get_type(ldb_module_get_private(ac->module), struct ltdb_private);
index a0df5d0b8a7f2366ae1879d682907e69320ddb1d..77938b77e5698460357fd399dba0c0cc68b6647b 100644 (file)
@@ -496,7 +496,7 @@ failed:
 static int search_func(struct ltdb_private *ltdb, struct ldb_val key, struct ldb_val val, void *state)
 {
        struct ldb_context *ldb;
-       struct ltdb_context *ac;
+       struct ldb_kv_context *ac;
        struct ldb_message *msg, *filtered_msg;
        int ret;
        bool matched;
@@ -506,7 +506,7 @@ static int search_func(struct ltdb_private *ltdb, struct ldb_val key, struct ldb
                .dsize = key.length
        };
 
-       ac = talloc_get_type(state, struct ltdb_context);
+       ac = talloc_get_type(state, struct ldb_kv_context);
        ldb = ldb_module_get_ctx(ac->module);
 
        if (ldb_kv_key_is_record(tdb_key) == false) {
@@ -580,7 +580,7 @@ static int search_func(struct ltdb_private *ltdb, struct ldb_val key, struct ldb
   search the database with a LDAP-like expression.
   this is the "full search" non-indexed variant
 */
-static int ldb_kv_search_full(struct ltdb_context *ctx)
+static int ldb_kv_search_full(struct ldb_kv_context *ctx)
 {
        void *data = ldb_module_get_private(ctx->module);
        struct ltdb_private *ltdb = talloc_get_type(data, struct ltdb_private);
@@ -597,7 +597,7 @@ static int ldb_kv_search_full(struct ltdb_context *ctx)
 }
 
 static int ldb_kv_search_and_return_base(struct ltdb_private *ltdb,
-                                        struct ltdb_context *ctx)
+                                        struct ldb_kv_context *ctx)
 {
        struct ldb_message *msg, *filtered_msg;
        struct ldb_context *ldb = ldb_module_get_ctx(ctx->module);
@@ -702,7 +702,7 @@ static int ldb_kv_search_and_return_base(struct ltdb_private *ltdb,
   search the database with a LDAP-like expression.
   choses a search method
 */
-int ldb_kv_search(struct ltdb_context *ctx)
+int ldb_kv_search(struct ldb_kv_context *ctx)
 {
        struct ldb_context *ldb;
        struct ldb_module *module = ctx->module;
index 29c0ead948ba53a6599c28eb164707255e01165c..1f0f0fca1302b2d4c6ab8e59e57b635fab405e6d 100644 (file)
@@ -57,7 +57,7 @@
   prevent memory errors on callbacks
 */
 struct ltdb_req_spy {
-       struct ltdb_context *ctx;
+       struct ldb_kv_context *ctx;
 };
 
 /*
@@ -671,7 +671,7 @@ static int ldb_kv_add_internal(struct ldb_module *module,
 /*
   add a record to the database
 */
-static int ldb_kv_add(struct ltdb_context *ctx)
+static int ldb_kv_add(struct ldb_kv_context *ctx)
 {
        struct ldb_module *module = ctx->module;
        struct ldb_request *req = ctx->req;
@@ -803,7 +803,7 @@ done:
 /*
   delete a record from the database
 */
-static int ldb_kv_delete(struct ltdb_context *ctx)
+static int ldb_kv_delete(struct ldb_kv_context *ctx)
 {
        struct ldb_module *module = ctx->module;
        struct ldb_request *req = ctx->req;
@@ -1335,7 +1335,7 @@ done:
 /*
   modify a record
 */
-static int ldb_kv_modify(struct ltdb_context *ctx)
+static int ldb_kv_modify(struct ldb_kv_context *ctx)
 {
        struct ldb_module *module = ctx->module;
        struct ldb_request *req = ctx->req;
@@ -1360,7 +1360,7 @@ static int ldb_kv_modify(struct ltdb_context *ctx)
 /*
   rename a record
 */
-static int ldb_kv_rename(struct ltdb_context *ctx)
+static int ldb_kv_rename(struct ldb_kv_context *ctx)
 {
        struct ldb_module *module = ctx->module;
        void *data = ldb_module_get_private(module);
@@ -1686,7 +1686,7 @@ static int ldb_kv_del_trans(struct ldb_module *module)
 /*
   return sequenceNumber from @BASEINFO
 */
-static int ldb_kv_sequence_number(struct ltdb_context *ctx,
+static int ldb_kv_sequence_number(struct ldb_kv_context *ctx,
                                  struct ldb_extended **ext)
 {
        struct ldb_context *ldb;
@@ -1779,7 +1779,7 @@ done:
        return ret;
 }
 
-static void ldb_kv_request_done(struct ltdb_context *ctx, int error)
+static void ldb_kv_request_done(struct ldb_kv_context *ctx, int error)
 {
        struct ldb_context *ldb;
        struct ldb_request *req;
@@ -1810,8 +1810,8 @@ static void ldb_kv_timeout(struct tevent_context *ev,
                           struct timeval t,
                           void *private_data)
 {
-       struct ltdb_context *ctx;
-       ctx = talloc_get_type(private_data, struct ltdb_context);
+       struct ldb_kv_context *ctx;
+       ctx = talloc_get_type(private_data, struct ldb_kv_context);
 
        if (!ctx->request_terminated) {
                /* request is done now */
@@ -1826,7 +1826,7 @@ static void ldb_kv_timeout(struct tevent_context *ev,
        talloc_free(ctx);
 }
 
-static void ldb_kv_request_extended_done(struct ltdb_context *ctx,
+static void ldb_kv_request_extended_done(struct ldb_kv_context *ctx,
                                         struct ldb_extended *ext,
                                         int error)
 {
@@ -1855,7 +1855,7 @@ static void ldb_kv_request_extended_done(struct ltdb_context *ctx,
        req->callback(req, ares);
 }
 
-static void ldb_kv_handle_extended(struct ltdb_context *ctx)
+static void ldb_kv_handle_extended(struct ldb_kv_context *ctx)
 {
        struct ldb_extended *ext = NULL;
        int ret;
@@ -2062,10 +2062,10 @@ static void ldb_kv_callback(struct tevent_context *ev,
                            struct timeval t,
                            void *private_data)
 {
-       struct ltdb_context *ctx;
+       struct ldb_kv_context *ctx;
        int ret;
 
-       ctx = talloc_get_type(private_data, struct ltdb_context);
+       ctx = talloc_get_type(private_data, struct ldb_kv_context);
 
        if (ctx->request_terminated) {
                goto done;
@@ -2128,7 +2128,7 @@ static int ldb_kv_handle_request(struct ldb_module *module,
        struct ldb_control *control_permissive;
        struct ldb_context *ldb;
        struct tevent_context *ev;
-       struct ltdb_context *ac;
+       struct ldb_kv_context *ac;
        struct tevent_timer *te;
        struct timeval tv;
        unsigned int i;
@@ -2154,7 +2154,7 @@ static int ldb_kv_handle_request(struct ldb_module *module,
 
        ev = ldb_handle_get_event_context(req->handle);
 
-       ac = talloc_zero(ldb, struct ltdb_context);
+       ac = talloc_zero(ldb, struct ldb_kv_context);
        if (ac == NULL) {
                ldb_oom(ldb);
                return LDB_ERR_OPERATIONS_ERROR;
index d7f6073a33d0a7b9212bf7aaf920a38969aef626..5c6cf98b1e43799fc6e278c78eafdb28773e9d84 100644 (file)
@@ -91,7 +91,7 @@ struct ltdb_private {
        pid_t pid;
 };
 
-struct ltdb_context {
+struct ldb_kv_context {
        struct ldb_module *module;
        struct ldb_request *req;
 
@@ -162,7 +162,7 @@ int ldb_kv_check_at_attributes_values(const struct ldb_val *value);
 
 struct ldb_parse_tree;
 
-int ldb_kv_search_indexed(struct ltdb_context *ctx, uint32_t *);
+int ldb_kv_search_indexed(struct ldb_kv_context *ctx, uint32_t *);
 int ldb_kv_index_add_new(struct ldb_module *module,
                         struct ltdb_private *ltdb,
                         const struct ldb_message *msg);
@@ -213,7 +213,7 @@ int ldb_kv_filter_attrs(TALLOC_CTX *mem_ctx,
                        const struct ldb_message *msg,
                        const char *const *attrs,
                        struct ldb_message **filtered_msg);
-int ldb_kv_search(struct ltdb_context *ctx);
+int ldb_kv_search(struct ldb_kv_context *ctx);
 
 /* The following definitions come from lib/ldb/ldb_tdb/ldb_tdb.c  */
 /*