summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/ldb_tdb
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-07-22 16:56:33 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:10:16 -0500
commitc93817b36d3ff7f44cb7b3e1d1a29e37ec12affe (patch)
tree70d3018287cbbe9ceee3cae3ab66ce33f32559aa /source4/lib/ldb/ldb_tdb
parent550f5fb26e67f46eead182476f7a9bcfd1ac5dc0 (diff)
downloadsamba-c93817b36d3ff7f44cb7b3e1d1a29e37ec12affe.tar.gz
samba-c93817b36d3ff7f44cb7b3e1d1a29e37ec12affe.tar.bz2
samba-c93817b36d3ff7f44cb7b3e1d1a29e37ec12affe.zip
r17185: Oh, I wanted to do this for sooo long time.
Finally acknowledge that ldb is inherently async and does not have a dual personality anymore Rename all ldb_async_XXX functions to ldb_XXX except for ldb_async_result, it is now ldb_reply to reflect the real function of this structure. Simo. (This used to be commit 25fc7354049d62efeba17681ef1cdd326bc3f2ef)
Diffstat (limited to 'source4/lib/ldb/ldb_tdb')
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_index.c12
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_search.c16
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_tdb.c32
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_tdb.h10
4 files changed, 35 insertions, 35 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_index.c b/source4/lib/ldb/ldb_tdb/ldb_index.c
index 3473ed3ac1..7b67db33d3 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_index.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_index.c
@@ -628,17 +628,17 @@ static int ltdb_index_dn(struct ldb_module *module,
extracting just the given attributes
*/
static int ltdb_index_filter(const struct dn_list *dn_list,
- struct ldb_async_handle *handle)
+ struct ldb_handle *handle)
{
- struct ltdb_async_context *ac = talloc_get_type(handle->private_data, struct ltdb_async_context);
- struct ldb_async_result *ares = NULL;
+ struct ltdb_context *ac = talloc_get_type(handle->private_data, struct ltdb_context);
+ struct ldb_reply *ares = NULL;
unsigned int i;
for (i = 0; i < dn_list->count; i++) {
struct ldb_dn *dn;
int ret;
- ares = talloc_zero(ac, struct ldb_async_result);
+ ares = talloc_zero(ac, struct ldb_reply);
if (!ares) {
handle->status = LDB_ERR_OPERATIONS_ERROR;
handle->state = LDB_ASYNC_DONE;
@@ -707,9 +707,9 @@ static int ltdb_index_filter(const struct dn_list *dn_list,
returns -1 if an indexed search is not possible, in which
case the caller should call ltdb_search_full()
*/
-int ltdb_search_indexed(struct ldb_async_handle *handle)
+int ltdb_search_indexed(struct ldb_handle *handle)
{
- struct ltdb_async_context *ac = talloc_get_type(handle->private_data, struct ltdb_async_context);
+ struct ltdb_context *ac = talloc_get_type(handle->private_data, struct ltdb_context);
struct ltdb_private *ltdb = talloc_get_type(ac->module->private_data, struct ltdb_private);
struct dn_list *dn_list;
int ret;
diff --git a/source4/lib/ldb/ldb_tdb/ldb_search.c b/source4/lib/ldb/ldb_tdb/ldb_search.c
index 529049e36b..62e310ede6 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_search.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_search.c
@@ -378,9 +378,9 @@ int ltdb_filter_attrs(struct ldb_message *msg, const char * const *attrs)
*/
static int search_func(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data, void *state)
{
- struct ldb_async_handle *handle = talloc_get_type(state, struct ldb_async_handle);
- struct ltdb_async_context *ac = talloc_get_type(handle->private_data, struct ltdb_async_context);
- struct ldb_async_result *ares = NULL;
+ struct ldb_handle *handle = talloc_get_type(state, struct ldb_handle);
+ struct ltdb_context *ac = talloc_get_type(handle->private_data, struct ltdb_context);
+ struct ldb_reply *ares = NULL;
int ret;
if (key.dsize < 4 ||
@@ -388,7 +388,7 @@ static int search_func(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data, voi
return 0;
}
- ares = talloc_zero(ac, struct ldb_async_result);
+ ares = talloc_zero(ac, struct ldb_reply);
if (!ares) {
handle->status = LDB_ERR_OPERATIONS_ERROR;
handle->state = LDB_ASYNC_DONE;
@@ -454,9 +454,9 @@ static int search_func(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data, voi
search the database with a LDAP-like expression.
this is the "full search" non-indexed variant
*/
-static int ltdb_search_full(struct ldb_async_handle *handle)
+static int ltdb_search_full(struct ldb_handle *handle)
{
- struct ltdb_async_context *ac = talloc_get_type(handle->private_data, struct ltdb_async_context);
+ struct ltdb_context *ac = talloc_get_type(handle->private_data, struct ltdb_context);
struct ltdb_private *ltdb = talloc_get_type(ac->module->private_data, struct ltdb_private);
int ret;
@@ -477,7 +477,7 @@ static int ltdb_search_full(struct ldb_async_handle *handle)
int ltdb_search(struct ldb_module *module, struct ldb_request *req)
{
struct ltdb_private *ltdb = talloc_get_type(module->private_data, struct ltdb_private);
- struct ltdb_async_context *ltdb_ac;
+ struct ltdb_context *ltdb_ac;
int ret;
if ((req->op.search.base == NULL || req->op.search.base->comp_num == 0) &&
@@ -504,7 +504,7 @@ int ltdb_search(struct ldb_module *module, struct ldb_request *req)
return LDB_ERR_OPERATIONS_ERROR;
}
- ltdb_ac = talloc_get_type(req->async.handle->private_data, struct ltdb_async_context);
+ ltdb_ac = talloc_get_type(req->async.handle->private_data, struct ltdb_context);
ltdb_ac->tree = req->op.search.tree;
ltdb_ac->scope = req->op.search.scope;
diff --git a/source4/lib/ldb/ldb_tdb/ldb_tdb.c b/source4/lib/ldb/ldb_tdb/ldb_tdb.c
index 090151cad9..ababedad15 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_tdb.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_tdb.c
@@ -78,14 +78,14 @@ static int ltdb_err_map(enum TDB_ERROR tdb_code)
}
-struct ldb_async_handle *init_ltdb_handle(struct ltdb_private *ltdb, struct ldb_module *module,
+struct ldb_handle *init_ltdb_handle(struct ltdb_private *ltdb, struct ldb_module *module,
void *context,
- int (*callback)(struct ldb_context *, void *, struct ldb_async_result *))
+ int (*callback)(struct ldb_context *, void *, struct ldb_reply *))
{
- struct ltdb_async_context *ac;
- struct ldb_async_handle *h;
+ struct ltdb_context *ac;
+ struct ldb_handle *h;
- h = talloc_zero(ltdb, struct ldb_async_handle);
+ h = talloc_zero(ltdb, struct ldb_handle);
if (h == NULL) {
ldb_set_errstring(module->ldb, talloc_asprintf(module, "Out of Memory"));
return NULL;
@@ -93,7 +93,7 @@ struct ldb_async_handle *init_ltdb_handle(struct ltdb_private *ltdb, struct ldb_
h->module = module;
- ac = talloc_zero(h, struct ltdb_async_context);
+ ac = talloc_zero(h, struct ltdb_context);
if (ac == NULL) {
ldb_set_errstring(module->ldb, talloc_asprintf(module, "Out of Memory"));
talloc_free(h);
@@ -288,7 +288,7 @@ static int ltdb_add_internal(struct ldb_module *module, const struct ldb_message
static int ltdb_add(struct ldb_module *module, struct ldb_request *req)
{
struct ltdb_private *ltdb = talloc_get_type(module->private_data, struct ltdb_private);
- struct ltdb_async_context *ltdb_ac;
+ struct ltdb_context *ltdb_ac;
int tret, ret = LDB_SUCCESS;
if (req->controls != NULL) {
@@ -302,7 +302,7 @@ static int ltdb_add(struct ldb_module *module, struct ldb_request *req)
if (req->async.handle == NULL) {
return LDB_ERR_OPERATIONS_ERROR;
}
- ltdb_ac = talloc_get_type(req->async.handle->private_data, struct ltdb_async_context);
+ ltdb_ac = talloc_get_type(req->async.handle->private_data, struct ltdb_context);
tret = ltdb_add_internal(module, req->op.add.message);
if (tret != LDB_SUCCESS) {
@@ -390,7 +390,7 @@ static int ltdb_delete_internal(struct ldb_module *module, const struct ldb_dn *
static int ltdb_delete(struct ldb_module *module, struct ldb_request *req)
{
struct ltdb_private *ltdb = talloc_get_type(module->private_data, struct ltdb_private);
- struct ltdb_async_context *ltdb_ac;
+ struct ltdb_context *ltdb_ac;
int tret, ret = LDB_SUCCESS;
if (req->controls != NULL) {
@@ -410,7 +410,7 @@ static int ltdb_delete(struct ldb_module *module, struct ldb_request *req)
if (req->async.handle == NULL) {
return LDB_ERR_OPERATIONS_ERROR;
}
- ltdb_ac = talloc_get_type(req->async.handle->private_data, struct ltdb_async_context);
+ ltdb_ac = talloc_get_type(req->async.handle->private_data, struct ltdb_context);
tret = ltdb_delete_internal(module, req->op.del.dn);
if (tret != LDB_SUCCESS) {
@@ -754,7 +754,7 @@ failed:
static int ltdb_modify(struct ldb_module *module, struct ldb_request *req)
{
struct ltdb_private *ltdb = talloc_get_type(module->private_data, struct ltdb_private);
- struct ltdb_async_context *ltdb_ac;
+ struct ltdb_context *ltdb_ac;
int tret, ret = LDB_SUCCESS;
if (req->controls != NULL) {
@@ -770,7 +770,7 @@ static int ltdb_modify(struct ldb_module *module, struct ldb_request *req)
if (req->async.handle == NULL) {
return LDB_ERR_OPERATIONS_ERROR;
}
- ltdb_ac = talloc_get_type(req->async.handle->private_data, struct ltdb_async_context);
+ ltdb_ac = talloc_get_type(req->async.handle->private_data, struct ltdb_context);
tret = ltdb_check_special_dn(module, req->op.mod.message);
if (tret != LDB_SUCCESS) {
@@ -803,7 +803,7 @@ done:
static int ltdb_rename(struct ldb_module *module, struct ldb_request *req)
{
struct ltdb_private *ltdb = talloc_get_type(module->private_data, struct ltdb_private);
- struct ltdb_async_context *ltdb_ac;
+ struct ltdb_context *ltdb_ac;
struct ldb_message *msg;
int tret, ret = LDB_SUCCESS;
@@ -824,7 +824,7 @@ static int ltdb_rename(struct ldb_module *module, struct ldb_request *req)
if (req->async.handle == NULL) {
return LDB_ERR_OPERATIONS_ERROR;
}
- ltdb_ac = talloc_get_type(req->async.handle->private_data, struct ltdb_async_context);
+ ltdb_ac = talloc_get_type(req->async.handle->private_data, struct ltdb_context);
msg = talloc(ltdb_ac, struct ldb_message);
if (msg == NULL) {
@@ -901,7 +901,7 @@ static int ltdb_del_trans(struct ldb_module *module)
return LDB_SUCCESS;
}
-static int ltdb_async_wait(struct ldb_async_handle *handle, enum ldb_async_wait_type type)
+static int ltdb_wait(struct ldb_handle *handle, enum ldb_wait_type type)
{
return handle->status;
}
@@ -965,7 +965,7 @@ static const struct ldb_module_ops ltdb_ops = {
.start_transaction = ltdb_start_trans,
.end_transaction = ltdb_end_trans,
.del_transaction = ltdb_del_trans,
- .async_wait = ltdb_async_wait,
+ .wait = ltdb_wait,
.sequence_number = ltdb_sequence_number
};
diff --git a/source4/lib/ldb/ldb_tdb/ldb_tdb.h b/source4/lib/ldb/ldb_tdb/ldb_tdb.h
index 069a07d319..7c6c5dfdb0 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_tdb.h
+++ b/source4/lib/ldb/ldb_tdb/ldb_tdb.h
@@ -33,7 +33,7 @@ struct ltdb_private {
the async local context
holds also internal search state during a full db search
*/
-struct ltdb_async_context {
+struct ltdb_context {
struct ldb_module *module;
/* search stuff */
@@ -44,7 +44,7 @@ struct ltdb_async_context {
/* async stuff */
void *context;
- int (*callback)(struct ldb_context *, void *, struct ldb_async_result *);
+ int (*callback)(struct ldb_context *, void *, struct ldb_reply *);
};
/* special record types */
@@ -71,7 +71,7 @@ int ltdb_check_at_attributes_values(const struct ldb_val *value);
struct ldb_parse_tree;
-int ltdb_search_indexed(struct ldb_async_handle *handle);
+int ltdb_search_indexed(struct ldb_handle *handle);
int ltdb_index_add(struct ldb_module *module, const struct ldb_message *msg);
int ltdb_index_del(struct ldb_module *module, const struct ldb_message *msg);
int ltdb_reindex(struct ldb_module *module);
@@ -103,9 +103,9 @@ int ltdb_filter_attrs(struct ldb_message *msg, const char * const *attrs);
int ltdb_search(struct ldb_module *module, struct ldb_request *req);
/* The following definitions come from lib/ldb/ldb_tdb/ldb_tdb.c */
-struct ldb_async_handle *init_ltdb_handle(struct ltdb_private *ltdb, struct ldb_module *module,
+struct ldb_handle *init_ltdb_handle(struct ltdb_private *ltdb, struct ldb_module *module,
void *context,
- int (*callback)(struct ldb_context *, void *, struct ldb_async_result *));
+ int (*callback)(struct ldb_context *, void *, struct ldb_reply *));
struct TDB_DATA ltdb_key(struct ldb_module *module, const struct ldb_dn *dn);
int ltdb_store(struct ldb_module *module, const struct ldb_message *msg, int flgs);
int ltdb_delete_noindex(struct ldb_module *module, const struct ldb_dn *dn);