From 49f68caed20d2a7d1850e493005bdf85929d6365 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sat, 22 Jul 2006 17:21:59 +0000 Subject: r17186: "async" word abuse clean-up part 2 (This used to be commit c6aa60c7e69abf1f83efc150b1c3ed02751c45fc) --- source4/dsdb/samdb/ldb_modules/extended_dn.c | 26 +++++----- source4/dsdb/samdb/ldb_modules/kludge_acl.c | 28 +++++------ source4/dsdb/samdb/ldb_modules/objectguid.c | 2 +- source4/dsdb/samdb/ldb_modules/partition.c | 10 ++-- source4/dsdb/samdb/ldb_modules/password_hash.c | 66 +++++++++++++------------- source4/dsdb/samdb/ldb_modules/rootdse.c | 22 ++++----- source4/dsdb/samdb/ldb_modules/samldb.c | 2 +- 7 files changed, 78 insertions(+), 78 deletions(-) (limited to 'source4/dsdb/samdb') diff --git a/source4/dsdb/samdb/ldb_modules/extended_dn.c b/source4/dsdb/samdb/ldb_modules/extended_dn.c index 0d8d49dea5..e79af57042 100644 --- a/source4/dsdb/samdb/ldb_modules/extended_dn.c +++ b/source4/dsdb/samdb/ldb_modules/extended_dn.c @@ -167,7 +167,7 @@ static BOOL inject_extended_dn(struct ldb_message *msg, } /* search */ -struct extended_async_context { +struct extended_context { struct ldb_module *module; void *up_context; @@ -179,16 +179,16 @@ struct extended_async_context { int extended_type; }; -static int extended_async_callback(struct ldb_context *ldb, void *context, struct ldb_reply *ares) +static int extended_callback(struct ldb_context *ldb, void *context, struct ldb_reply *ares) { - struct extended_async_context *ac; + struct extended_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 extended_async_context); + ac = talloc_get_type(context, struct extended_context); if (ares->type == LDB_REPLY_ENTRY) { /* for each record returned post-process to add any derived @@ -205,12 +205,12 @@ error: return LDB_ERR_OPERATIONS_ERROR; } -static int extended_search_async(struct ldb_module *module, struct ldb_request *req) +static int extended_search(struct ldb_module *module, struct ldb_request *req) { struct ldb_control *control; struct ldb_extended_dn_control *extended_ctrl; struct ldb_control **saved_controls; - struct extended_async_context *ac; + struct extended_context *ac; struct ldb_request *down_req; char **new_attrs; int ret; @@ -227,14 +227,14 @@ static int extended_search_async(struct ldb_module *module, struct ldb_request * return LDB_ERR_PROTOCOL_ERROR; } - ac = talloc(req, struct extended_async_context); + ac = talloc(req, struct extended_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; ac->remove_guid = False; ac->remove_sid = False; @@ -285,8 +285,8 @@ static int extended_search_async(struct ldb_module *module, struct ldb_request * return LDB_ERR_OPERATIONS_ERROR; } - down_req->async.context = ac; - down_req->async.callback = extended_async_callback; + down_req->context = ac; + down_req->callback = extended_callback; ldb_set_timeout_from_prev_req(module->ldb, req, down_req); /* perform the search */ @@ -295,7 +295,7 @@ static int extended_search_async(struct ldb_module *module, struct ldb_request * /* 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; @@ -328,7 +328,7 @@ static int extended_init(struct ldb_module *module) static const struct ldb_module_ops extended_dn_ops = { .name = "extended_dn", - .search = extended_search_async, + .search = extended_search, .init_context = extended_init }; diff --git a/source4/dsdb/samdb/ldb_modules/kludge_acl.c b/source4/dsdb/samdb/ldb_modules/kludge_acl.c index 09173f0aa4..ecb3e00f95 100644 --- a/source4/dsdb/samdb/ldb_modules/kludge_acl.c +++ b/source4/dsdb/samdb/ldb_modules/kludge_acl.c @@ -98,7 +98,7 @@ static const char *user_name(TALLOC_CTX *mem_ctx, struct ldb_module *module) } /* search */ -struct kludge_acl_async_context { +struct kludge_acl_context { struct ldb_module *module; void *up_context; @@ -107,9 +107,9 @@ struct kludge_acl_async_context { enum user_is user_type; }; -static int kludge_acl_async_callback(struct ldb_context *ldb, void *context, struct ldb_reply *ares) +static int kludge_acl_callback(struct ldb_context *ldb, void *context, struct ldb_reply *ares) { - struct kludge_acl_async_context *ac; + struct kludge_acl_context *ac; struct kludge_private_data *data; int i; @@ -118,7 +118,7 @@ static int kludge_acl_async_callback(struct ldb_context *ldb, void *context, str goto error; } - ac = talloc_get_type(context, struct kludge_acl_async_context); + ac = talloc_get_type(context, struct kludge_acl_context); data = talloc_get_type(ac->module->private_data, struct kludge_private_data); if (ares->type == LDB_REPLY_ENTRY @@ -143,22 +143,22 @@ error: return LDB_ERR_OPERATIONS_ERROR; } -static int kludge_acl_search_async(struct ldb_module *module, struct ldb_request *req) +static int kludge_acl_search(struct ldb_module *module, struct ldb_request *req) { - struct kludge_acl_async_context *ac; + struct kludge_acl_context *ac; struct ldb_request *down_req; int ret; - req->async.handle = NULL; + req->handle = NULL; - ac = talloc(req, struct kludge_acl_async_context); + ac = talloc(req, struct kludge_acl_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->user_type = what_is_user(module); down_req = talloc_zero(req, struct ldb_request); @@ -174,8 +174,8 @@ static int kludge_acl_search_async(struct ldb_module *module, struct ldb_request down_req->controls = req->controls; - down_req->async.context = ac; - down_req->async.callback = kludge_acl_async_callback; + down_req->context = ac; + down_req->callback = kludge_acl_callback; ldb_set_timeout_from_prev_req(module->ldb, req, down_req); /* perform the search */ @@ -184,7 +184,7 @@ static int kludge_acl_search_async(struct ldb_module *module, struct ldb_request /* 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; @@ -271,7 +271,7 @@ done: static const struct ldb_module_ops kludge_acl_ops = { .name = "kludge_acl", - .search = kludge_acl_search_async, + .search = kludge_acl_search, .add = kludge_acl_change, .modify = kludge_acl_change, .del = kludge_acl_change, diff --git a/source4/dsdb/samdb/ldb_modules/objectguid.c b/source4/dsdb/samdb/ldb_modules/objectguid.c index 3f6a951997..1f18f0e603 100644 --- a/source4/dsdb/samdb/ldb_modules/objectguid.c +++ b/source4/dsdb/samdb/ldb_modules/objectguid.c @@ -107,7 +107,7 @@ static int objectguid_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; diff --git a/source4/dsdb/samdb/ldb_modules/partition.c b/source4/dsdb/samdb/ldb_modules/partition.c index 0dcf710ba4..92fddca270 100644 --- a/source4/dsdb/samdb/ldb_modules/partition.c +++ b/source4/dsdb/samdb/ldb_modules/partition.c @@ -167,7 +167,7 @@ static int partition_search(struct ldb_module *module, struct ldb_request *req) return LDB_ERR_OPERATIONS_ERROR; } /* return our own handle to deal with this call */ - req->async.handle = h; + req->handle = h; ac = talloc_get_type(h->private_data, struct partition_context); @@ -537,18 +537,18 @@ static int partition_wait_none(struct ldb_handle *handle) { ac = talloc_get_type(handle->private_data, struct partition_context); for (i=0; i < ac->num_searches; i++) { - ret = ldb_wait(ac->search_req[i]->async.handle, LDB_WAIT_NONE); + ret = ldb_wait(ac->search_req[i]->handle, LDB_WAIT_NONE); if (ret != LDB_SUCCESS) { handle->status = ret; goto done; } - if (ac->search_req[i]->async.handle->status != LDB_SUCCESS) { - handle->status = ac->search_req[i]->async.handle->status; + if (ac->search_req[i]->handle->status != LDB_SUCCESS) { + handle->status = ac->search_req[i]->handle->status; goto done; } - if (ac->search_req[i]->async.handle->state != LDB_ASYNC_DONE) { + if (ac->search_req[i]->handle->state != LDB_ASYNC_DONE) { return LDB_SUCCESS; } } diff --git a/source4/dsdb/samdb/ldb_modules/password_hash.c b/source4/dsdb/samdb/ldb_modules/password_hash.c index d6c2a45217..ec42249633 100644 --- a/source4/dsdb/samdb/ldb_modules/password_hash.c +++ b/source4/dsdb/samdb/ldb_modules/password_hash.c @@ -509,9 +509,9 @@ static int build_domain_data_request(struct ph_context *ac) } ac->dom_req->op.search.attrs = attrs; ac->dom_req->controls = NULL; - ac->dom_req->async.context = ac; - ac->dom_req->async.callback = get_domain_data_callback; - ac->dom_req->async.timeout = ac->orig_req->async.timeout; + ac->dom_req->context = ac; + ac->dom_req->callback = get_domain_data_callback; + ac->dom_req->timeout = ac->orig_req->timeout; ldb_set_timeout_from_prev_req(ac->module->ldb, ac->orig_req, ac->dom_req); return LDB_SUCCESS; @@ -637,7 +637,7 @@ static int password_hash_add(struct ldb_module *module, struct ldb_request *req) ac->step = PH_ADD_SEARCH_DOM; - req->async.handle = h; + req->handle = h; return ldb_next_request(module, ac->dom_req); } @@ -787,7 +787,7 @@ static int password_hash_modify(struct ldb_module *module, struct ldb_request *r ac = talloc_get_type(h->private_data, struct ph_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_zero(ac, struct ldb_request); @@ -814,8 +814,8 @@ static int password_hash_modify(struct ldb_module *module, struct ldb_request *r return password_hash_mod_search_self(h); } - ac->down_req->async.context = NULL; - ac->down_req->async.callback = NULL; + ac->down_req->context = NULL; + ac->down_req->callback = NULL; ac->step = PH_MOD_DO_REQ; @@ -889,8 +889,8 @@ static int password_hash_mod_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 = PH_MOD_SEARCH_SELF; @@ -1079,18 +1079,18 @@ static int ph_wait(struct ldb_handle *handle) { switch (ac->step) { case PH_ADD_SEARCH_DOM: - ret = ldb_wait(ac->dom_req->async.handle, LDB_WAIT_NONE); + ret = ldb_wait(ac->dom_req->handle, LDB_WAIT_NONE); if (ret != LDB_SUCCESS) { handle->status = ret; goto done; } - if (ac->dom_req->async.handle->status != LDB_SUCCESS) { - handle->status = ac->dom_req->async.handle->status; + if (ac->dom_req->handle->status != LDB_SUCCESS) { + handle->status = ac->dom_req->handle->status; goto done; } - if (ac->dom_req->async.handle->state != LDB_ASYNC_DONE) { + if (ac->dom_req->handle->state != LDB_ASYNC_DONE) { return LDB_SUCCESS; } @@ -1098,36 +1098,36 @@ static int ph_wait(struct ldb_handle *handle) { return password_hash_add_do_add(handle); case PH_ADD_DO_ADD: - 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; } break; case PH_MOD_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; } @@ -1135,18 +1135,18 @@ static int ph_wait(struct ldb_handle *handle) { return password_hash_mod_search_self(handle); case PH_MOD_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; } @@ -1154,18 +1154,18 @@ static int ph_wait(struct ldb_handle *handle) { return password_hash_mod_search_dom(handle); case PH_MOD_SEARCH_DOM: - ret = ldb_wait(ac->dom_req->async.handle, LDB_WAIT_NONE); + ret = ldb_wait(ac->dom_req->handle, LDB_WAIT_NONE); if (ret != LDB_SUCCESS) { handle->status = ret; goto done; } - if (ac->dom_req->async.handle->status != LDB_SUCCESS) { - handle->status = ac->dom_req->async.handle->status; + if (ac->dom_req->handle->status != LDB_SUCCESS) { + handle->status = ac->dom_req->handle->status; goto done; } - if (ac->dom_req->async.handle->state != LDB_ASYNC_DONE) { + if (ac->dom_req->handle->state != LDB_ASYNC_DONE) { return LDB_SUCCESS; } @@ -1173,18 +1173,18 @@ static int ph_wait(struct ldb_handle *handle) { return password_hash_mod_do_mod(handle); case PH_MOD_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/dsdb/samdb/ldb_modules/rootdse.c b/source4/dsdb/samdb/ldb_modules/rootdse.c index 01421d2817..efb3d9a05f 100644 --- a/source4/dsdb/samdb/ldb_modules/rootdse.c +++ b/source4/dsdb/samdb/ldb_modules/rootdse.c @@ -139,7 +139,7 @@ failed: handle search requests */ -struct rootdse_async_context { +struct rootdse_context { struct ldb_module *module; void *up_context; int (*up_callback)(struct ldb_context *, void *, struct ldb_reply *); @@ -147,16 +147,16 @@ struct rootdse_async_context { const char * const * attrs; }; -static int rootdse_async_callback(struct ldb_context *ldb, void *context, struct ldb_reply *ares) +static int rootdse_callback(struct ldb_context *ldb, void *context, struct ldb_reply *ares) { - struct rootdse_async_context *ac; + struct rootdse_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 rootdse_async_context); + ac = talloc_get_type(context, struct rootdse_context); if (ares->type == LDB_REPLY_ENTRY) { /* for each record returned post-process to add any dynamic @@ -175,7 +175,7 @@ error: static int rootdse_search(struct ldb_module *module, struct ldb_request *req) { - struct rootdse_async_context *ac; + struct rootdse_context *ac; struct ldb_request *down_req; int ret; @@ -185,14 +185,14 @@ static int rootdse_search(struct ldb_module *module, struct ldb_request *req) return ldb_next_request(module, req); } - ac = talloc(req, struct rootdse_async_context); + ac = talloc(req, struct rootdse_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); @@ -213,8 +213,8 @@ static int rootdse_search(struct ldb_module *module, struct ldb_request *req) down_req->op.search.attrs = req->op.search.attrs; down_req->controls = req->controls; - down_req->async.context = ac; - down_req->async.callback = rootdse_async_callback; + down_req->context = ac; + down_req->callback = rootdse_callback; ldb_set_timeout_from_prev_req(module->ldb, req, down_req); /* perform the search */ @@ -223,7 +223,7 @@ static int rootdse_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; diff --git a/source4/dsdb/samdb/ldb_modules/samldb.c b/source4/dsdb/samdb/ldb_modules/samldb.c index 81bfa32398..d0c278257e 100644 --- a/source4/dsdb/samdb/ldb_modules/samldb.c +++ b/source4/dsdb/samdb/ldb_modules/samldb.c @@ -740,7 +740,7 @@ static int samldb_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; -- cgit