From: Gary Lockyer Date: Thu, 19 Jul 2018 21:07:47 +0000 (+1200) Subject: lib ldb: rename ltdb_context to ldb_kv_context X-Git-Tag: ldb-1.5.0~88 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c782d710e97ffaed8fef18524b468e801be053d3;p=thirdparty%2Fsamba.git lib ldb: rename ltdb_context to ldb_kv_context Rename ltdb_context to ldb_kv_context as it is a key value level structure and not tdb specific. Signed-off-by: Gary Lockyer Reviewed-by: Andrew Bartlett --- diff --git a/lib/ldb/ldb_tdb/ldb_index.c b/lib/ldb/ldb_tdb/ldb_index.c index 1399f6902de..a04431ef7b9 100644 --- a/lib/ldb/ldb_tdb/ldb_index.c +++ b/lib/ldb/ldb_tdb/ldb_index.c @@ -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); diff --git a/lib/ldb/ldb_tdb/ldb_search.c b/lib/ldb/ldb_tdb/ldb_search.c index a0df5d0b8a7..77938b77e56 100644 --- a/lib/ldb/ldb_tdb/ldb_search.c +++ b/lib/ldb/ldb_tdb/ldb_search.c @@ -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; diff --git a/lib/ldb/ldb_tdb/ldb_tdb.c b/lib/ldb/ldb_tdb/ldb_tdb.c index 29c0ead948b..1f0f0fca130 100644 --- a/lib/ldb/ldb_tdb/ldb_tdb.c +++ b/lib/ldb/ldb_tdb/ldb_tdb.c @@ -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; diff --git a/lib/ldb/ldb_tdb/ldb_tdb.h b/lib/ldb/ldb_tdb/ldb_tdb.h index d7f6073a33d..5c6cf98b1e4 100644 --- a/lib/ldb/ldb_tdb/ldb_tdb.h +++ b/lib/ldb/ldb_tdb/ldb_tdb.h @@ -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 */ /*