svn commit: samba r13823 - in branches/SAMBA_4_0/source: dsdb/samdb/ldb_modules lib/ldb/common lib/ldb/include lib/ldb/ldb_ildap lib/ldb/ldb_ldap lib/ldb/ldb_tdb

idra at samba.org idra at samba.org
Fri Mar 3 20:01:20 GMT 2006


Author: idra
Date: 2006-03-03 20:01:19 +0000 (Fri, 03 Mar 2006)
New Revision: 13823

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13823

Log:

make async_wait part of the modules ops


Modified:
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/rootdse.c
   branches/SAMBA_4_0/source/lib/ldb/common/ldb.c
   branches/SAMBA_4_0/source/lib/ldb/common/ldb_modules.c
   branches/SAMBA_4_0/source/lib/ldb/include/ldb_private.h
   branches/SAMBA_4_0/source/lib/ldb/ldb_ildap/ldb_ildap.c
   branches/SAMBA_4_0/source/lib/ldb/ldb_ldap/ldb_ldap.c
   branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_search.c
   branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c


Changeset:
Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/rootdse.c
===================================================================
--- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/rootdse.c	2006-03-03 19:43:57 UTC (rev 13822)
+++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/rootdse.c	2006-03-03 20:01:19 UTC (rev 13823)
@@ -217,7 +217,7 @@
 
 static const struct ldb_module_ops rootdse_ops = {
 	.name			= "rootdse",
-	.init_context	= rootdse_init,
+	.init_context           = rootdse_init,
 	.request		= rootdse_request
 };
 

Modified: branches/SAMBA_4_0/source/lib/ldb/common/ldb.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/common/ldb.c	2006-03-03 19:43:57 UTC (rev 13822)
+++ branches/SAMBA_4_0/source/lib/ldb/common/ldb.c	2006-03-03 20:01:19 UTC (rev 13823)
@@ -125,7 +125,7 @@
 #define FIRST_OP(ldb, op) do { \
 	module = ldb->modules; \
 	while (module && module->ops->op == NULL) module = module->next; \
-	if (module == NULL) return -1; \
+	if (module == NULL) return LDB_ERR_OPERATIONS_ERROR; \
 } while (0)
 
 /*
@@ -208,10 +208,11 @@
 
 int ldb_async_wait(struct ldb_context *ldb, struct ldb_async_handle *handle, enum ldb_async_wait_type type)
 {
-	if (ldb->async_wait != NULL)
-		return ldb->async_wait(handle, type);
+	struct ldb_module *module;
 
-	return LDB_ERR_OPERATIONS_ERROR;
+	FIRST_OP(ldb, async_wait);
+
+	return module->ops->async_wait(module, handle, type);
 }
 
 /*

Modified: branches/SAMBA_4_0/source/lib/ldb/common/ldb_modules.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/common/ldb_modules.c	2006-03-03 19:43:57 UTC (rev 13822)
+++ branches/SAMBA_4_0/source/lib/ldb/common/ldb_modules.c	2006-03-03 20:01:19 UTC (rev 13823)
@@ -278,7 +278,7 @@
 #define FIND_OP(module, op) do { \
 	module = module->next; \
 	while (module && module->ops->op == NULL) module = module->next; \
-	if (module == NULL) return LDB_ERR_OTHER; \
+	if (module == NULL) return LDB_ERR_OPERATIONS_ERROR; \
 } while (0)
 
 
@@ -324,3 +324,9 @@
 	FIND_OP(module, del_transaction);
 	return module->ops->del_transaction(module);
 }
+
+int ldb_next_async_wait(struct ldb_module *module, struct ldb_async_handle *handle, enum ldb_async_wait_type type)
+{
+	FIND_OP(module, async_wait);
+	return module->ops->async_wait(module, handle, type);
+}

Modified: branches/SAMBA_4_0/source/lib/ldb/include/ldb_private.h
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/include/ldb_private.h	2006-03-03 19:43:57 UTC (rev 13822)
+++ branches/SAMBA_4_0/source/lib/ldb/include/ldb_private.h	2006-03-03 20:01:19 UTC (rev 13823)
@@ -61,6 +61,7 @@
 	int (*start_transaction)(struct ldb_module *);
 	int (*end_transaction)(struct ldb_module *);
 	int (*del_transaction)(struct ldb_module *);
+	int (*async_wait)(struct ldb_module *, struct ldb_async_handle *, enum ldb_async_wait_type);
 };
 
 
@@ -106,8 +107,6 @@
 
 	int transaction_active;
 
-	int (*async_wait)(struct ldb_async_handle *, enum ldb_async_wait_type);
-
 	/* a backend supplied highestCommittedUSN function */
 	uint64_t (*sequence_number)(struct ldb_context *);
 };

Modified: branches/SAMBA_4_0/source/lib/ldb/ldb_ildap/ldb_ildap.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/ldb_ildap/ldb_ildap.c	2006-03-03 19:43:57 UTC (rev 13822)
+++ branches/SAMBA_4_0/source/lib/ldb/ldb_ildap/ldb_ildap.c	2006-03-03 20:01:19 UTC (rev 13823)
@@ -913,7 +913,7 @@
 	}
 }
 
-static int ildb_async_wait(struct ldb_async_handle *handle, enum ldb_async_wait_type type)
+static int ildb_async_wait(struct ldb_module *module, struct ldb_async_handle *handle, enum ldb_async_wait_type type)
 {
 	struct ildb_async_context *ac = talloc_get_type(handle->private_data, struct ildb_async_context);
 
@@ -977,6 +977,7 @@
 	.start_transaction = ildb_start_trans,
 	.end_transaction   = ildb_end_trans,
 	.del_transaction   = ildb_del_trans,
+	.async_wait        = ildb_async_wait,
 	.init_context	   = ildb_init
 };
 
@@ -1051,8 +1052,6 @@
 		}
 	}
 
-	ldb->async_wait = &ildb_async_wait;
-
 	return 0;
 
 failed:

Modified: branches/SAMBA_4_0/source/lib/ldb/ldb_ldap/ldb_ldap.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/ldb_ldap/ldb_ldap.c	2006-03-03 19:43:57 UTC (rev 13822)
+++ branches/SAMBA_4_0/source/lib/ldb/ldb_ldap/ldb_ldap.c	2006-03-03 20:01:19 UTC (rev 13823)
@@ -860,7 +860,7 @@
 	return handle->status;
 }
 
-static int lldb_async_wait(struct ldb_async_handle *handle, enum ldb_async_wait_type type)
+static int lldb_async_wait(struct ldb_module *module, struct ldb_async_handle *handle, enum ldb_async_wait_type type)
 {
 	struct lldb_async_context *ac = talloc_get_type(handle->private_data, struct lldb_async_context);
 	struct lldb_private *lldb = talloc_get_type(ac->module->private_data, struct lldb_private);
@@ -1027,6 +1027,7 @@
 	.start_transaction = lldb_start_trans,
 	.end_transaction   = lldb_end_trans,
 	.del_transaction   = lldb_del_trans,
+	.async_wait        = lldb_async_wait
 };
 
 
@@ -1084,8 +1085,6 @@
 	ldb->modules->private_data = lldb;
 	ldb->modules->ops = &lldb_ops;
 
-	ldb->async_wait = &lldb_async_wait;
-
 	return 0;
 
 failed:

Modified: branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_search.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_search.c	2006-03-03 19:43:57 UTC (rev 13822)
+++ branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_search.c	2006-03-03 20:01:19 UTC (rev 13823)
@@ -475,7 +475,7 @@
 
 static int ltdb_search_sync_callback(struct ldb_context *ldb, void *context, struct ldb_async_result *ares)
 {
-	struct ldb_result *res;
+	struct ldb_result *res = NULL;
 	
  	if (!context) {
 		ldb_set_errstring(ldb, talloc_strdup(ldb, "NULL Context in callback"));

Modified: branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c	2006-03-03 19:43:57 UTC (rev 13822)
+++ branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c	2006-03-03 20:01:19 UTC (rev 13823)
@@ -917,7 +917,7 @@
 	return LDB_SUCCESS;
 }
 
-static int ltdb_async_wait(struct ldb_async_handle *handle, enum ldb_async_wait_type type)
+static int ltdb_async_wait(struct ldb_module *module, struct ldb_async_handle *handle, enum ldb_async_wait_type type)
 {
 	return handle->status;
 }
@@ -1038,7 +1038,8 @@
 	.request           = ltdb_request,
 	.start_transaction = ltdb_start_trans,
 	.end_transaction   = ltdb_end_trans,
-	.del_transaction   = ltdb_del_trans
+	.del_transaction   = ltdb_del_trans,
+	.async_wait        = ltdb_async_wait
 };
 
 
@@ -1104,7 +1105,5 @@
 	ldb->modules->ops = &ltdb_ops;
 	ldb->sequence_number = ltdb_sequence_number;
 
-	ldb->async_wait = &ltdb_async_wait;
-
 	return 0;
 }



More information about the samba-cvs mailing list