summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/modules
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-07-22 17:21:59 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:10:17 -0500
commit49f68caed20d2a7d1850e493005bdf85929d6365 (patch)
tree6c81b47125cbe4a597c379d8876d919832cde4db /source4/lib/ldb/modules
parentc93817b36d3ff7f44cb7b3e1d1a29e37ec12affe (diff)
downloadsamba-49f68caed20d2a7d1850e493005bdf85929d6365.tar.gz
samba-49f68caed20d2a7d1850e493005bdf85929d6365.tar.bz2
samba-49f68caed20d2a7d1850e493005bdf85929d6365.zip
r17186: "async" word abuse clean-up part 2
(This used to be commit c6aa60c7e69abf1f83efc150b1c3ed02751c45fc)
Diffstat (limited to 'source4/lib/ldb/modules')
-rw-r--r--source4/lib/ldb/modules/asq.c34
-rw-r--r--source4/lib/ldb/modules/objectclass.c42
-rw-r--r--source4/lib/ldb/modules/operational.c28
-rw-r--r--source4/lib/ldb/modules/paged_results.c22
-rw-r--r--source4/lib/ldb/modules/rdn_name.c20
-rw-r--r--source4/lib/ldb/modules/sort.c18
6 files changed, 82 insertions, 82 deletions
diff --git a/source4/lib/ldb/modules/asq.c b/source4/lib/ldb/modules/asq.c
index 466286e8cd..110470c8bb 100644
--- a/source4/lib/ldb/modules/asq.c
+++ b/source4/lib/ldb/modules/asq.c
@@ -217,9 +217,9 @@ static int asq_search(struct ldb_module *module, struct ldb_request *req)
return ldb_next_request(module, req);
}
- req->async.handle = NULL;
+ req->handle = NULL;
- if (!req->async.callback || !req->async.context) {
+ if (!req->callback || !req->context) {
ldb_set_errstring(module->ldb, talloc_asprintf(module,
"Async interface called with NULL callback function or NULL context"));
return LDB_ERR_OPERATIONS_ERROR;
@@ -230,13 +230,13 @@ static int asq_search(struct ldb_module *module, struct ldb_request *req)
return LDB_ERR_PROTOCOL_ERROR;
}
- h = init_handle(req, module, req->async.context, req->async.callback);
+ h = init_handle(req, module, req->context, req->callback);
if (!h) {
return LDB_ERR_OPERATIONS_ERROR;
}
ac = talloc_get_type(h->private_data, struct asq_context);
- req->async.handle = h;
+ req->handle = h;
/* check the search is well formed */
if (req->op.search.scope != LDB_SCOPE_BASE) {
@@ -266,8 +266,8 @@ static int asq_search(struct ldb_module *module, struct ldb_request *req)
base_attrs[1] = NULL;
ac->base_req->op.search.attrs = (const char * const *)base_attrs;
- ac->base_req->async.context = ac;
- ac->base_req->async.callback = asq_base_callback;
+ ac->base_req->context = ac;
+ ac->base_req->callback = asq_base_callback;
ldb_set_timeout_from_prev_req(module->ldb, req, ac->base_req);
ac->step = ASQ_SEARCH_BASE;
@@ -319,8 +319,8 @@ static int asq_requests(struct ldb_handle *handle) {
ac->reqs[i]->op.search.tree = ac->base_req->op.search.tree;
ac->reqs[i]->op.search.attrs = ac->req_attrs;
- ac->reqs[i]->async.context = ac;
- ac->reqs[i]->async.callback = asq_reqs_callback;
+ ac->reqs[i]->context = ac;
+ ac->reqs[i]->callback = asq_reqs_callback;
ldb_set_timeout_from_prev_req(ac->module->ldb, ac->base_req, ac->reqs[i]);
}
@@ -350,18 +350,18 @@ static int asq_wait_none(struct ldb_handle *handle)
switch (ac->step) {
case ASQ_SEARCH_BASE:
- ret = ldb_wait(ac->base_req->async.handle, LDB_WAIT_NONE);
+ ret = ldb_wait(ac->base_req->handle, LDB_WAIT_NONE);
if (ret != LDB_SUCCESS) {
handle->status = ret;
goto done;
}
- if (ac->base_req->async.handle->status != LDB_SUCCESS) {
- handle->status = ac->base_req->async.handle->status;
+ if (ac->base_req->handle->status != LDB_SUCCESS) {
+ handle->status = ac->base_req->handle->status;
goto done;
}
- if (ac->base_req->async.handle->state != LDB_ASYNC_DONE) {
+ if (ac->base_req->handle->state != LDB_ASYNC_DONE) {
return LDB_SUCCESS;
}
@@ -369,24 +369,24 @@ static int asq_wait_none(struct ldb_handle *handle)
case ASQ_SEARCH_MULTI:
- if (ac->reqs[ac->cur_req]->async.handle == NULL) {
+ if (ac->reqs[ac->cur_req]->handle == NULL) {
ret = ldb_request(ac->module->ldb, ac->reqs[ac->cur_req]);
if (ret != LDB_SUCCESS) {
return ret;
}
}
- ret = ldb_wait(ac->reqs[ac->cur_req]->async.handle, LDB_WAIT_NONE);
+ ret = ldb_wait(ac->reqs[ac->cur_req]->handle, LDB_WAIT_NONE);
if (ret != LDB_SUCCESS) {
handle->status = ret;
goto done;
}
- if (ac->reqs[ac->cur_req]->async.handle->status != LDB_SUCCESS) {
- handle->status = ac->reqs[ac->cur_req]->async.handle->status;
+ if (ac->reqs[ac->cur_req]->handle->status != LDB_SUCCESS) {
+ handle->status = ac->reqs[ac->cur_req]->handle->status;
}
- if (ac->reqs[ac->cur_req]->async.handle->state == LDB_ASYNC_DONE) {
+ if (ac->reqs[ac->cur_req]->handle->state == LDB_ASYNC_DONE) {
ac->cur_req++;
}
diff --git a/source4/lib/ldb/modules/objectclass.c b/source4/lib/ldb/modules/objectclass.c
index 03ff58e994..a8c99226cd 100644
--- a/source4/lib/ldb/modules/objectclass.c
+++ b/source4/lib/ldb/modules/objectclass.c
@@ -283,7 +283,7 @@ static int objectclass_add(struct ldb_module *module, struct ldb_request *req)
/* do not free down_req as the call results may be linked to it,
* it will be freed when the upper level request get freed */
if (ret == LDB_SUCCESS) {
- req->async.handle = down_req->async.handle;
+ req->handle = down_req->handle;
}
return ret;
}
@@ -382,7 +382,7 @@ static int objectclass_modify(struct ldb_module *module, struct ldb_request *req
/* do not free down_req as the call results may be linked to it,
* it will be freed when the upper level request get freed */
if (ret == LDB_SUCCESS) {
- req->async.handle = down_req->async.handle;
+ req->handle = down_req->handle;
}
return ret;
}
@@ -399,7 +399,7 @@ static int objectclass_modify(struct ldb_module *module, struct ldb_request *req
ac = talloc_get_type(h->private_data, struct oc_context);
/* return or own handle to deal with this call */
- req->async.handle = h;
+ req->handle = h;
/* prepare the first operation */
ac->down_req = talloc(ac, struct ldb_request);
@@ -410,8 +410,8 @@ static int objectclass_modify(struct ldb_module *module, struct ldb_request *req
*(ac->down_req) = *req; /* copy the request */
- ac->down_req->async.context = NULL;
- ac->down_req->async.callback = NULL;
+ ac->down_req->context = NULL;
+ ac->down_req->callback = NULL;
ldb_set_timeout_from_prev_req(module->ldb, req, ac->down_req);
ac->step = OC_DO_REQ;
@@ -471,8 +471,8 @@ static int objectclass_search_self(struct ldb_handle *h) {
}
ac->search_req->op.search.attrs = attrs;
ac->search_req->controls = NULL;
- ac->search_req->async.context = ac;
- ac->search_req->async.callback = get_self_callback;
+ ac->search_req->context = ac;
+ ac->search_req->callback = get_self_callback;
ldb_set_timeout_from_prev_req(ac->module->ldb, ac->orig_req, ac->search_req);
ac->step = OC_SEARCH_SELF;
@@ -504,8 +504,8 @@ static int objectclass_do_mod(struct ldb_handle *h) {
ac->mod_req->operation = LDB_MODIFY;
ac->mod_req->controls = NULL;
- ac->mod_req->async.context = ac;
- ac->mod_req->async.callback = NULL;
+ ac->mod_req->context = ac;
+ ac->mod_req->callback = NULL;
ldb_set_timeout_from_prev_req(ac->module->ldb, ac->orig_req, ac->mod_req);
/* use a new message structure */
@@ -590,18 +590,18 @@ static int oc_wait(struct ldb_handle *handle) {
switch (ac->step) {
case OC_DO_REQ:
- ret = ldb_wait(ac->down_req->async.handle, LDB_WAIT_NONE);
+ ret = ldb_wait(ac->down_req->handle, LDB_WAIT_NONE);
if (ret != LDB_SUCCESS) {
handle->status = ret;
goto done;
}
- if (ac->down_req->async.handle->status != LDB_SUCCESS) {
- handle->status = ac->down_req->async.handle->status;
+ if (ac->down_req->handle->status != LDB_SUCCESS) {
+ handle->status = ac->down_req->handle->status;
goto done;
}
- if (ac->down_req->async.handle->state != LDB_ASYNC_DONE) {
+ if (ac->down_req->handle->state != LDB_ASYNC_DONE) {
return LDB_SUCCESS;
}
@@ -609,18 +609,18 @@ static int oc_wait(struct ldb_handle *handle) {
return objectclass_search_self(handle);
case OC_SEARCH_SELF:
- ret = ldb_wait(ac->search_req->async.handle, LDB_WAIT_NONE);
+ ret = ldb_wait(ac->search_req->handle, LDB_WAIT_NONE);
if (ret != LDB_SUCCESS) {
handle->status = ret;
goto done;
}
- if (ac->search_req->async.handle->status != LDB_SUCCESS) {
- handle->status = ac->search_req->async.handle->status;
+ if (ac->search_req->handle->status != LDB_SUCCESS) {
+ handle->status = ac->search_req->handle->status;
goto done;
}
- if (ac->search_req->async.handle->state != LDB_ASYNC_DONE) {
+ if (ac->search_req->handle->state != LDB_ASYNC_DONE) {
return LDB_SUCCESS;
}
@@ -628,18 +628,18 @@ static int oc_wait(struct ldb_handle *handle) {
return objectclass_do_mod(handle);
case OC_DO_MOD:
- ret = ldb_wait(ac->mod_req->async.handle, LDB_WAIT_NONE);
+ ret = ldb_wait(ac->mod_req->handle, LDB_WAIT_NONE);
if (ret != LDB_SUCCESS) {
handle->status = ret;
goto done;
}
- if (ac->mod_req->async.handle->status != LDB_SUCCESS) {
- handle->status = ac->mod_req->async.handle->status;
+ if (ac->mod_req->handle->status != LDB_SUCCESS) {
+ handle->status = ac->mod_req->handle->status;
goto done;
}
- if (ac->mod_req->async.handle->state != LDB_ASYNC_DONE) {
+ if (ac->mod_req->handle->state != LDB_ASYNC_DONE) {
return LDB_SUCCESS;
}
diff --git a/source4/lib/ldb/modules/operational.c b/source4/lib/ldb/modules/operational.c
index 4cadaa27ee..7e7c8d83ad 100644
--- a/source4/lib/ldb/modules/operational.c
+++ b/source4/lib/ldb/modules/operational.c
@@ -226,7 +226,7 @@ static int add_uint64_element(struct ldb_message *msg, const char *attr, uint64_
hook search operations
*/
-struct operational_async_context {
+struct operational_context {
struct ldb_module *module;
void *up_context;
@@ -235,16 +235,16 @@ struct operational_async_context {
const char * const *attrs;
};
-static int operational_async_callback(struct ldb_context *ldb, void *context, struct ldb_reply *ares)
+static int operational_callback(struct ldb_context *ldb, void *context, struct ldb_reply *ares)
{
- struct operational_async_context *ac;
+ struct operational_context *ac;
if (!context || !ares) {
ldb_set_errstring(ldb, talloc_asprintf(ldb, "NULL Context or Result in callback"));
goto error;
}
- ac = talloc_get_type(context, struct operational_async_context);
+ ac = talloc_get_type(context, struct operational_context);
if (ares->type == LDB_REPLY_ENTRY) {
/* for each record returned post-process to add any derived
@@ -263,21 +263,21 @@ error:
static int operational_search(struct ldb_module *module, struct ldb_request *req)
{
- struct operational_async_context *ac;
+ struct operational_context *ac;
struct ldb_request *down_req;
const char **search_attrs = NULL;
int i, a, ret;
- req->async.handle = NULL;
+ req->handle = NULL;
- ac = talloc(req, struct operational_async_context);
+ ac = talloc(req, struct operational_context);
if (ac == NULL) {
return LDB_ERR_OPERATIONS_ERROR;
}
ac->module = module;
- ac->up_context = req->async.context;
- ac->up_callback = req->async.callback;
+ ac->up_context = req->context;
+ ac->up_callback = req->callback;
ac->attrs = req->op.search.attrs;
down_req = talloc_zero(req, struct ldb_request);
@@ -325,8 +325,8 @@ static int operational_search(struct ldb_module *module, struct ldb_request *req
down_req->controls = req->controls;
- down_req->async.context = ac;
- down_req->async.callback = operational_async_callback;
+ down_req->context = ac;
+ down_req->callback = operational_callback;
ldb_set_timeout_from_prev_req(module->ldb, req, down_req);
/* perform the search */
@@ -335,7 +335,7 @@ static int operational_search(struct ldb_module *module, struct ldb_request *req
/* do not free down_req as the call results may be linked to it,
* it will be freed when the upper level request get freed */
if (ret == LDB_SUCCESS) {
- req->async.handle = down_req->async.handle;
+ req->handle = down_req->handle;
}
return ret;
@@ -392,7 +392,7 @@ static int operational_add(struct ldb_module *module, struct ldb_request *req)
/* do not free down_req as the call results may be linked to it,
* it will be freed when the upper level request get freed */
if (ret == LDB_SUCCESS) {
- req->async.handle = down_req->async.handle;
+ req->handle = down_req->handle;
}
return ret;
@@ -449,7 +449,7 @@ static int operational_modify(struct ldb_module *module, struct ldb_request *req
/* do not free down_req as the call results may be linked to it,
* it will be freed when the upper level request get freed */
if (ret == LDB_SUCCESS) {
- req->async.handle = down_req->async.handle;
+ req->handle = down_req->handle;
}
return ret;
diff --git a/source4/lib/ldb/modules/paged_results.c b/source4/lib/ldb/modules/paged_results.c
index 3f2ff66b32..2d972b7316 100644
--- a/source4/lib/ldb/modules/paged_results.c
+++ b/source4/lib/ldb/modules/paged_results.c
@@ -251,9 +251,9 @@ static int paged_search(struct ldb_module *module, struct ldb_request *req)
private_data = talloc_get_type(module->private_data, struct private_data);
- req->async.handle = NULL;
+ req->handle = NULL;
- if (!req->async.callback || !req->async.context) {
+ if (!req->callback || !req->context) {
ldb_set_errstring(module->ldb, talloc_asprintf(module,
"Async interface called with NULL callback function or NULL context"));
return LDB_ERR_OPERATIONS_ERROR;
@@ -264,7 +264,7 @@ static int paged_search(struct ldb_module *module, struct ldb_request *req)
return LDB_ERR_PROTOCOL_ERROR;
}
- h = init_handle(req, module, req->async.context, req->async.callback);
+ h = init_handle(req, module, req->context, req->callback);
if (!h) {
return LDB_ERR_OPERATIONS_ERROR;
}
@@ -299,8 +299,8 @@ static int paged_search(struct ldb_module *module, struct ldb_request *req)
return LDB_ERR_OPERATIONS_ERROR;
}
- ac->store->req->async.context = ac;
- ac->store->req->async.callback = paged_search_callback;
+ ac->store->req->context = ac;
+ ac->store->req->callback = paged_search_callback;
ldb_set_timeout_from_prev_req(module->ldb, req, ac->store->req);
ret = ldb_next_request(module, ac->store->req);
@@ -323,7 +323,7 @@ static int paged_search(struct ldb_module *module, struct ldb_request *req)
ret = LDB_SUCCESS;
}
- req->async.handle = h;
+ req->handle = h;
/* check if it is an abandon */
if (ac->size == 0) {
@@ -463,7 +463,7 @@ static int paged_wait(struct ldb_handle *handle, enum ldb_wait_type type)
ac = talloc_get_type(handle->private_data, struct paged_context);
- if (ac->store->req->async.handle->state == LDB_ASYNC_DONE) {
+ if (ac->store->req->handle->state == LDB_ASYNC_DONE) {
/* if lower level is finished we do not need to call it anymore */
/* return all we have until size == 0 or we empty storage */
ret = paged_results(handle);
@@ -478,8 +478,8 @@ static int paged_wait(struct ldb_handle *handle, enum ldb_wait_type type)
}
if (type == LDB_WAIT_ALL) {
- while (ac->store->req->async.handle->state != LDB_ASYNC_DONE) {
- ret = ldb_wait(ac->store->req->async.handle, type);
+ while (ac->store->req->handle->state != LDB_ASYNC_DONE) {
+ ret = ldb_wait(ac->store->req->handle, type);
if (ret != LDB_SUCCESS) {
handle->state = LDB_ASYNC_DONE;
handle->status = ret;
@@ -498,7 +498,7 @@ static int paged_wait(struct ldb_handle *handle, enum ldb_wait_type type)
return ret;
}
- ret = ldb_wait(ac->store->req->async.handle, type);
+ ret = ldb_wait(ac->store->req->handle, type);
if (ret != LDB_SUCCESS) {
handle->state = LDB_ASYNC_DONE;
handle->status = ret;
@@ -508,7 +508,7 @@ static int paged_wait(struct ldb_handle *handle, enum ldb_wait_type type)
handle->status = ret;
if (ac->store->num_entries >= ac->size ||
- ac->store->req->async.handle->state == LDB_ASYNC_DONE) {
+ ac->store->req->handle->state == LDB_ASYNC_DONE) {
ret = paged_results(handle);
diff --git a/source4/lib/ldb/modules/rdn_name.c b/source4/lib/ldb/modules/rdn_name.c
index b005b49c55..fce1d34ac0 100644
--- a/source4/lib/ldb/modules/rdn_name.c
+++ b/source4/lib/ldb/modules/rdn_name.c
@@ -128,7 +128,7 @@ static int rdn_name_add(struct ldb_module *module, struct ldb_request *req)
/* do not free down_req as the call results may be linked to it,
* it will be freed when the upper level request get freed */
if (ret == LDB_SUCCESS) {
- req->async.handle = down_req->async.handle;
+ req->handle = down_req->handle;
}
return ret;
@@ -181,7 +181,7 @@ static int rdn_name_rename(struct ldb_module *module, struct ldb_request *req)
ac->step = RENAME_RENAME;
- req->async.handle = h;
+ req->handle = h;
/* rename first, modify "name" if rename is ok */
return ldb_next_request(module, ac->down_req);
@@ -254,17 +254,17 @@ static int rename_wait(struct ldb_handle *handle)
switch(ac->step) {
case RENAME_RENAME:
- ret = ldb_wait(ac->down_req->async.handle, LDB_WAIT_NONE);
+ ret = ldb_wait(ac->down_req->handle, LDB_WAIT_NONE);
if (ret != LDB_SUCCESS) {
handle->status = ret;
goto done;
}
- if (ac->down_req->async.handle->status != LDB_SUCCESS) {
- handle->status = ac->down_req->async.handle->status;
+ if (ac->down_req->handle->status != LDB_SUCCESS) {
+ handle->status = ac->down_req->handle->status;
goto done;
}
- if (ac->down_req->async.handle->state != LDB_ASYNC_DONE) {
+ if (ac->down_req->handle->state != LDB_ASYNC_DONE) {
return LDB_SUCCESS;
}
@@ -272,17 +272,17 @@ static int rename_wait(struct ldb_handle *handle)
return rdn_name_rename_do_mod(handle);
case RENAME_MODIFY:
- ret = ldb_wait(ac->mod_req->async.handle, LDB_WAIT_NONE);
+ ret = ldb_wait(ac->mod_req->handle, LDB_WAIT_NONE);
if (ret != LDB_SUCCESS) {
handle->status = ret;
goto done;
}
- if (ac->mod_req->async.handle->status != LDB_SUCCESS) {
- handle->status = ac->mod_req->async.handle->status;
+ if (ac->mod_req->handle->status != LDB_SUCCESS) {
+ handle->status = ac->mod_req->handle->status;
goto done;
}
- if (ac->mod_req->async.handle->state != LDB_ASYNC_DONE) {
+ if (ac->mod_req->handle->state != LDB_ASYNC_DONE) {
return LDB_SUCCESS;
}
diff --git a/source4/lib/ldb/modules/sort.c b/source4/lib/ldb/modules/sort.c
index 261bae7e78..1ab034f4fb 100644
--- a/source4/lib/ldb/modules/sort.c
+++ b/source4/lib/ldb/modules/sort.c
@@ -242,14 +242,14 @@ static int server_sort_search(struct ldb_module *module, struct ldb_request *req
return ldb_next_request(module, req);
}
- req->async.handle = NULL;
+ req->handle = NULL;
- if (!req->async.callback || !req->async.context) {
+ if (!req->callback || !req->context) {
ldb_set_errstring(module->ldb, talloc_asprintf(module, "Async interface called with NULL callback function or NULL context"));
return LDB_ERR_OPERATIONS_ERROR;
}
- h = init_handle(req, module, req->async.context, req->async.callback);
+ h = init_handle(req, module, req->context, req->callback);
if (!h) {
return LDB_ERR_OPERATIONS_ERROR;
}
@@ -310,11 +310,11 @@ static int server_sort_search(struct ldb_module *module, struct ldb_request *req
return LDB_ERR_OPERATIONS_ERROR;
}
- ac->req->async.context = ac;
- ac->req->async.callback = server_sort_search_callback;
+ ac->req->context = ac;
+ ac->req->callback = server_sort_search_callback;
ldb_set_timeout_from_prev_req(module->ldb, req, ac->req);
- req->async.handle = h;
+ req->handle = h;
return ldb_next_request(module, ac->req);
}
@@ -398,15 +398,15 @@ static int server_sort_wait(struct ldb_handle *handle, enum ldb_wait_type type)
ac = talloc_get_type(handle->private_data, struct sort_context);
- ret = ldb_wait(ac->req->async.handle, type);
+ ret = ldb_wait(ac->req->handle, type);
if (ret != LDB_SUCCESS) {
handle->status = ret;
return ret;
}
- handle->state = ac->req->async.handle->state;
- handle->status = ac->req->async.handle->status;
+ handle->state = ac->req->handle->state;
+ handle->status = ac->req->handle->status;
if (handle->status != LDB_SUCCESS) {
return handle->status;