summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/modules/operational.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-05-29 01:30:02 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:08:41 -0500
commit3a4d7eb2c08a06fac89c34d132f1c32751ce7ad5 (patch)
tree7d34281bba70aaa79d7527b823f00f625836dc3a /source4/lib/ldb/modules/operational.c
parent0bd3636a1249dd55f7595c06892e2db65af18bfc (diff)
downloadsamba-3a4d7eb2c08a06fac89c34d132f1c32751ce7ad5.tar.gz
samba-3a4d7eb2c08a06fac89c34d132f1c32751ce7ad5.tar.bz2
samba-3a4d7eb2c08a06fac89c34d132f1c32751ce7ad5.zip
r15927: Optimize ldb module traverse while keeping the API intact.
I was sick of jumping inot each module for each request, even the ones not handle by that module. (This used to be commit 7d65105e885a28584e8555453b90232c43a92bf7)
Diffstat (limited to 'source4/lib/ldb/modules/operational.c')
-rw-r--r--source4/lib/ldb/modules/operational.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/source4/lib/ldb/modules/operational.c b/source4/lib/ldb/modules/operational.c
index d796e93e54..b47adf0652 100644
--- a/source4/lib/ldb/modules/operational.c
+++ b/source4/lib/ldb/modules/operational.c
@@ -295,7 +295,7 @@ static int add_uint64_element(struct ldb_message *msg, const char *attr, uint64_
/*
hook add record ops
*/
-static int operational_add(struct ldb_module *module, struct ldb_request *req)
+static int operational_add_sync(struct ldb_module *module, struct ldb_request *req)
{
const struct ldb_message *msg = req->op.add.message;
time_t t = time(NULL);
@@ -341,7 +341,7 @@ static int operational_add(struct ldb_module *module, struct ldb_request *req)
/*
hook modify record ops
*/
-static int operational_modify(struct ldb_module *module, struct ldb_request *req)
+static int operational_modify_sync(struct ldb_module *module, struct ldb_request *req)
{
const struct ldb_message *msg = req->op.mod.message;
time_t t = time(NULL);
@@ -421,7 +421,7 @@ error:
return LDB_ERR_OPERATIONS_ERROR;
}
-static int operational_search_async(struct ldb_module *module, struct ldb_request *req)
+static int operational_search(struct ldb_module *module, struct ldb_request *req)
{
struct operational_async_context *ac;
struct ldb_request *down_req;
@@ -506,7 +506,7 @@ static int operational_search_async(struct ldb_module *module, struct ldb_reques
/*
hook add record ops
*/
-static int operational_add_async(struct ldb_module *module, struct ldb_request *req)
+static int operational_add(struct ldb_module *module, struct ldb_request *req)
{
struct ldb_request *down_req;
struct ldb_message *msg;
@@ -560,7 +560,7 @@ static int operational_add_async(struct ldb_module *module, struct ldb_request *
/*
hook modify record ops
*/
-static int operational_modify_async(struct ldb_module *module, struct ldb_request *req)
+static int operational_modify(struct ldb_module *module, struct ldb_request *req)
{
struct ldb_request *down_req;
struct ldb_message *msg;
@@ -617,19 +617,10 @@ static int operational_request(struct ldb_module *module, struct ldb_request *re
return operational_search_bytree(module, req);
case LDB_REQ_ADD:
- return operational_add(module, req);
+ return operational_add_sync(module, req);
case LDB_REQ_MODIFY:
- return operational_modify(module, req);
-
- case LDB_ASYNC_SEARCH:
- return operational_search_async(module, req);
-
- case LDB_ASYNC_ADD:
- return operational_add_async(module, req);
-
- case LDB_ASYNC_MODIFY:
- return operational_modify_async(module, req);
+ return operational_modify_sync(module, req);
default:
return ldb_next_request(module, req);
@@ -650,6 +641,9 @@ static int operational_init(struct ldb_module *ctx)
static const struct ldb_module_ops operational_ops = {
.name = "operational",
+ .search = operational_search,
+ .add = operational_add,
+ .modify = operational_modify,
.request = operational_request,
.init_context = operational_init
};