From 6a77165c8ad3fdf37218e37352859926eca48922 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 14 Oct 2009 14:13:52 +1100 Subject: s4:dsdb Only reload partition metadata on search and transaction start I see no reason to reload it when in a transaction - it can't change on us anyway (we possibly need to watch for our own changes to @PARTITION however) Andrew Bartlett --- source4/dsdb/samdb/ldb_modules/partition.c | 15 +++++---------- source4/dsdb/samdb/ldb_modules/partition_init.c | 9 --------- 2 files changed, 5 insertions(+), 19 deletions(-) (limited to 'source4') diff --git a/source4/dsdb/samdb/ldb_modules/partition.c b/source4/dsdb/samdb/ldb_modules/partition.c index 4626eefa7c..ea5dff7dce 100644 --- a/source4/dsdb/samdb/ldb_modules/partition.c +++ b/source4/dsdb/samdb/ldb_modules/partition.c @@ -413,11 +413,6 @@ static int partition_replicate(struct ldb_module *module, struct ldb_request *re return ldb_next_request(module, req); } - ret = partition_reload_if_required(module, data); - if (ret != LDB_SUCCESS) { - return ret; - } - if (req->operation != LDB_SEARCH) { /* Is this a special DN, we need to replicate to every backend? */ for (i=0; data->replicate && data->replicate[i]; i++) { @@ -638,11 +633,6 @@ static int partition_rename(struct ldb_module *module, struct ldb_request *req) return LDB_ERR_OPERATIONS_ERROR; } - ret = partition_reload_if_required(module, data); - if (ret != LDB_SUCCESS) { - return ret; - } - backend = find_partition(data, req->op.rename.olddn, req); backend2 = find_partition(data, req->op.rename.newdn, req); @@ -678,6 +668,11 @@ static int partition_start_trans(struct ldb_module *module) return ret; } + ret = partition_reload_if_required(module, data); + if (ret != LDB_SUCCESS) { + return ret; + } + for (i=0; data && data->partitions && data->partitions[i]; i++) { struct ldb_module *next = data->partitions[i]->module; PARTITION_FIND_OP(next, start_transaction); diff --git a/source4/dsdb/samdb/ldb_modules/partition_init.c b/source4/dsdb/samdb/ldb_modules/partition_init.c index 2da938d20e..3fbd2c128a 100644 --- a/source4/dsdb/samdb/ldb_modules/partition_init.c +++ b/source4/dsdb/samdb/ldb_modules/partition_init.c @@ -479,20 +479,11 @@ int partition_create(struct ldb_module *module, struct ldb_request *req) struct ldb_dn *dn = ex_op->new_dn; data = talloc_get_type(module->private_data, struct partition_private_data); - if (!data) { - return LDB_ERR_OPERATIONS_ERROR; - } - if (!data) { /* We are not going to create a partition before we are even set up */ return LDB_ERR_UNWILLING_TO_PERFORM; } - ret = partition_reload_metadata(module, data, req, NULL); - if (ret != LDB_SUCCESS) { - return ret; - } - for (i=0; data->partitions && data->partitions[i]; i++) { if (ldb_dn_compare(data->partitions[i]->ctrl->dn, dn) == 0) { partition = data->partitions[i]; -- cgit