summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/modules
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2005-09-17 19:25:50 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:38:14 -0500
commit8919d6bf9a88ce9ac43dae61989c33082c984b66 (patch)
tree55302a32ab9da077db48a69313fe648abdf578c9 /source4/lib/ldb/modules
parentf1d065128d8715e9ee34a31bbdc60d9d4e00a6a8 (diff)
downloadsamba-8919d6bf9a88ce9ac43dae61989c33082c984b66.tar.gz
samba-8919d6bf9a88ce9ac43dae61989c33082c984b66.tar.bz2
samba-8919d6bf9a88ce9ac43dae61989c33082c984b66.zip
r10299: remove the public (un)lock functions and introduce a transaction based
private ldb API ldb_sqlite3 is already working with this model and ldb_tdb will do as soon as tridge finishes the tdb transaction code. currently the transactions are always implicit and wrap any single ldb API call except searching, the transaction functions are currently not made public on purpose. Simo. (This used to be commit 1da4ac2cdcb7e54076f85242a93784260dced918)
Diffstat (limited to 'source4/lib/ldb/modules')
-rw-r--r--source4/lib/ldb/modules/ldb_map.c28
-rw-r--r--source4/lib/ldb/modules/rdn_name.c32
-rw-r--r--source4/lib/ldb/modules/schema.c28
-rw-r--r--source4/lib/ldb/modules/skel.c32
-rw-r--r--source4/lib/ldb/modules/timestamps.c32
5 files changed, 76 insertions, 76 deletions
diff --git a/source4/lib/ldb/modules/ldb_map.c b/source4/lib/ldb/modules/ldb_map.c
index ba98a5f495..93ae13ffc2 100644
--- a/source4/lib/ldb/modules/ldb_map.c
+++ b/source4/lib/ldb/modules/ldb_map.c
@@ -1256,14 +1256,14 @@ static int map_modify(struct ldb_module *module, const struct ldb_message *msg)
return (mp_ret == -1 || fb_ret == -1)?-1:0;
}
-static int map_lock(struct ldb_module *module, const char *lockname)
+static int map_start_trans(struct ldb_module *module)
{
- return ldb_next_named_lock(module, lockname);
+ return ldb_next_start_trans(module);
}
-static int map_unlock(struct ldb_module *module, const char *lockname)
+static int map_end_trans(struct ldb_module *module, int status)
{
- return ldb_next_named_unlock(module, lockname);
+ return ldb_next_end_trans(module, status);
}
/*
@@ -1280,16 +1280,16 @@ static const char *map_errstring(struct ldb_module *module)
}
static const struct ldb_module_ops map_ops = {
- .name = "map",
- .search = map_search,
- .search_bytree = map_search_bytree,
- .add_record = map_add,
- .modify_record = map_modify,
- .delete_record = map_delete,
- .rename_record = map_rename,
- .named_lock = map_lock,
- .named_unlock = map_unlock,
- .errstring = map_errstring
+ .name = "map",
+ .search = map_search,
+ .search_bytree = map_search_bytree,
+ .add_record = map_add,
+ .modify_record = map_modify,
+ .delete_record = map_delete,
+ .rename_record = map_rename,
+ .start_transaction = map_start_trans,
+ .end_transaction = map_end_trans,
+ .errstring = map_errstring
};
static char *map_find_url(struct ldb_context *ldb, const char *name)
diff --git a/source4/lib/ldb/modules/rdn_name.c b/source4/lib/ldb/modules/rdn_name.c
index 09e9c72811..ed5400176c 100644
--- a/source4/lib/ldb/modules/rdn_name.c
+++ b/source4/lib/ldb/modules/rdn_name.c
@@ -217,16 +217,16 @@ static int rdn_name_rename_record(struct ldb_module *module, const struct ldb_dn
return ldb_next_rename_record(module, olddn, newdn);
}
-static int rdn_name_lock(struct ldb_module *module, const char *lockname)
+static int rdn_start_trans(struct ldb_module *module)
{
- ldb_debug(module->ldb, LDB_DEBUG_TRACE, "rdn_name_lock\n");
- return ldb_next_named_lock(module, lockname);
+ ldb_debug(module->ldb, LDB_DEBUG_TRACE, "rdn_start_trans\n");
+ return ldb_next_start_trans(module);
}
-static int rdn_name_unlock(struct ldb_module *module, const char *lockname)
+static int rdn_end_trans(struct ldb_module *module, int status)
{
- ldb_debug(module->ldb, LDB_DEBUG_TRACE, "rdn_name_unlock\n");
- return ldb_next_named_unlock(module, lockname);
+ ldb_debug(module->ldb, LDB_DEBUG_TRACE, "rdn_end_trans\n");
+ return ldb_next_end_trans(module, status);
}
/* return extended error information */
@@ -254,16 +254,16 @@ static int rdn_name_destructor(void *module_ctx)
}
static const struct ldb_module_ops rdn_name_ops = {
- .name = "rdn_name",
- .search = rdn_name_search,
- .search_bytree = rdn_name_search_bytree,
- .add_record = rdn_name_add_record,
- .modify_record = rdn_name_modify_record,
- .delete_record = rdn_name_delete_record,
- .rename_record = rdn_name_rename_record,
- .named_lock = rdn_name_lock,
- .named_unlock = rdn_name_unlock,
- .errstring = rdn_name_errstring
+ .name = "rdn_name",
+ .search = rdn_name_search,
+ .search_bytree = rdn_name_search_bytree,
+ .add_record = rdn_name_add_record,
+ .modify_record = rdn_name_modify_record,
+ .delete_record = rdn_name_delete_record,
+ .rename_record = rdn_name_rename_record,
+ .start_transaction = rdn_start_trans,
+ .end_transaction = rdn_end_trans,
+ .errstring = rdn_name_errstring
};
diff --git a/source4/lib/ldb/modules/schema.c b/source4/lib/ldb/modules/schema.c
index baf038de0c..9406d54ce7 100644
--- a/source4/lib/ldb/modules/schema.c
+++ b/source4/lib/ldb/modules/schema.c
@@ -501,12 +501,12 @@ static int schema_rename_record(struct ldb_module *module, const struct ldb_dn *
return ldb_next_rename_record(module, olddn, newdn);
}
-static int schema_named_lock(struct ldb_module *module, const char *name) {
- return ldb_next_named_lock(module, name);
+static int schema_start_trans(struct ldb_module *module) {
+ return ldb_next_start_trans(module);
}
-static int schema_named_unlock(struct ldb_module *module, const char *name) {
- return ldb_next_named_unlock(module, name);
+static int schema_end_trans(struct ldb_module *module, int status) {
+ return ldb_next_end_trans(module, status);
}
/* return extended error information */
@@ -533,16 +533,16 @@ static int schema_destructor(void *module_ctx)
}
static const struct ldb_module_ops schema_ops = {
- .name = "schema",
- .search = schema_search,
- .search_bytree = schema_search_bytree,
- .add_record = schema_add_record,
- .modify_record = schema_modify_record,
- .delete_record = schema_delete_record,
- .rename_record = schema_rename_record,
- .named_lock = schema_named_lock,
- .named_unlock = schema_named_unlock,
- .errstring = schema_errstring,
+ .name = "schema",
+ .search = schema_search,
+ .search_bytree = schema_search_bytree,
+ .add_record = schema_add_record,
+ .modify_record = schema_modify_record,
+ .delete_record = schema_delete_record,
+ .rename_record = schema_rename_record,
+ .start_transaction = schema_start_trans,
+ .end_transaction = schema_end_trans,
+ .errstring = schema_errstring,
};
#ifdef HAVE_DLOPEN_DISABLED
diff --git a/source4/lib/ldb/modules/skel.c b/source4/lib/ldb/modules/skel.c
index 57c89a6a65..37c0417c64 100644
--- a/source4/lib/ldb/modules/skel.c
+++ b/source4/lib/ldb/modules/skel.c
@@ -73,16 +73,16 @@ static int skel_rename_record(struct ldb_module *module, const struct ldb_dn *ol
return ldb_next_rename_record(module, olddn, newdn);
}
-/* named_lock */
-static int skel_named_lock(struct ldb_module *module, const char *lockname)
+/* start a transaction */
+static int skel_start_trans(struct ldb_module *module)
{
- return ldb_next_named_lock(module, lockname);
+ return ldb_next_start_trans(module);
}
-/* named_unlock */
-static int skel_named_unlock(struct ldb_module *module, const char *lockname)
+/* end a transaction */
+static int skel_end_trans(struct ldb_module *module, int status)
{
- return ldb_next_named_unlock(module, lockname);
+ return ldb_next_end_trans(module, status);
}
/* return extended error information */
@@ -101,16 +101,16 @@ static int skel_destructor(void *module_ctx)
}
static const struct ldb_module_ops skel_ops = {
- .name = "skel",
- .search = skel_search,
- .search_bytree = skel_search_bytree,
- .add_record = skel_add_record,
- .modify_record = skel_modify_record,
- .delete_record = skel_delete_record,
- .rename_record = skel_rename_record,
- .named_lock = skel_named_lock,
- .named_unlock = skel_named_unlock,
- .errstring = skel_errstring
+ .name = "skel",
+ .search = skel_search,
+ .search_bytree = skel_search_bytree,
+ .add_record = skel_add_record,
+ .modify_record = skel_modify_record,
+ .delete_record = skel_delete_record,
+ .rename_record = skel_rename_record,
+ .start_transaction = skel_start_trans,
+ .end_transaction = skel_end_trans,
+ .errstring = skel_errstring
};
#ifdef HAVE_DLOPEN_DISABLED
diff --git a/source4/lib/ldb/modules/timestamps.c b/source4/lib/ldb/modules/timestamps.c
index f712505211..6687b1929d 100644
--- a/source4/lib/ldb/modules/timestamps.c
+++ b/source4/lib/ldb/modules/timestamps.c
@@ -215,16 +215,16 @@ static int timestamps_rename_record(struct ldb_module *module, const struct ldb_
return ldb_next_rename_record(module, olddn, newdn);
}
-static int timestamps_lock(struct ldb_module *module, const char *lockname)
+static int timestamps_start_trans(struct ldb_module *module)
{
- ldb_debug(module->ldb, LDB_DEBUG_TRACE, "timestamps_lock\n");
- return ldb_next_named_lock(module, lockname);
+ ldb_debug(module->ldb, LDB_DEBUG_TRACE, "timestamps_start_trans\n");
+ return ldb_next_start_trans(module);
}
-static int timestamps_unlock(struct ldb_module *module, const char *lockname)
+static int timestamps_end_trans(struct ldb_module *module, int status)
{
- ldb_debug(module->ldb, LDB_DEBUG_TRACE, "timestamps_unlock\n");
- return ldb_next_named_unlock(module, lockname);
+ ldb_debug(module->ldb, LDB_DEBUG_TRACE, "timestamps_end_trans\n");
+ return ldb_next_end_trans(module, status);
}
/* return extended error information */
@@ -252,16 +252,16 @@ static int timestamps_destructor(void *module_ctx)
}
static const struct ldb_module_ops timestamps_ops = {
- .name = "timestamps",
- .search = timestamps_search,
- .search_bytree = timestamps_search_bytree,
- .add_record = timestamps_add_record,
- .modify_record = timestamps_modify_record,
- .delete_record = timestamps_delete_record,
- .rename_record = timestamps_rename_record,
- .named_lock = timestamps_lock,
- .named_unlock = timestamps_unlock,
- .errstring = timestamps_errstring
+ .name = "timestamps",
+ .search = timestamps_search,
+ .search_bytree = timestamps_search_bytree,
+ .add_record = timestamps_add_record,
+ .modify_record = timestamps_modify_record,
+ .delete_record = timestamps_delete_record,
+ .rename_record = timestamps_rename_record,
+ .start_transaction = timestamps_start_trans,
+ .end_transaction = timestamps_end_trans,
+ .errstring = timestamps_errstring
};