Skip to content

Commit

Permalink
lib ldb: rename ltdb_context to ldb_kv_context
Browse files Browse the repository at this point in the history
Rename ltdb_context to ldb_kv_context as it is a key value level
structure and not tdb specific.

Signed-off-by: Gary Lockyer <[email protected]>
Reviewed-by: Andrew Bartlett <[email protected]>
  • Loading branch information
GaryWL authored and abartlet committed Jul 30, 2018
1 parent e969de0 commit c782d71
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions lib/ldb/ldb_tdb/ldb_index.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions lib/ldb/ldb_tdb/ldb_search.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ int ldb_kv_filter_attrs(TALLOC_CTX *mem_ctx,
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;
Expand All @@ -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) {
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
30 changes: 15 additions & 15 deletions lib/ldb/ldb_tdb/ldb_tdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
prevent memory errors on callbacks
*/
struct ltdb_req_spy {
struct ltdb_context *ctx;
struct ldb_kv_context *ctx;
};

/*
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -803,7 +803,7 @@ static int ldb_kv_delete_internal(struct ldb_module *module, struct ldb_dn *dn)
/*
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;
Expand Down Expand Up @@ -1335,7 +1335,7 @@ int ldb_kv_modify_internal(struct ldb_module *module,
/*
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;
Expand All @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -1779,7 +1779,7 @@ static int ldb_kv_sequence_number(struct ltdb_context *ctx,
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;
Expand Down Expand Up @@ -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 */
Expand All @@ -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)
{
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions lib/ldb/ldb_tdb/ldb_tdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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 */
/*
Expand Down

0 comments on commit c782d71

Please sign in to comment.