summaryrefslogtreecommitdiffstats
path: root/ldap/servers/slapd/back-ldbm/close.c
diff options
context:
space:
mode:
authorcvsadm <cvsadm>2005-01-21 00:44:34 +0000
committercvsadm <cvsadm>2005-01-21 00:44:34 +0000
commitb2093e3016027d6b5cf06b3f91f30769bfc099e2 (patch)
treecf58939393a9032182c4fbc4441164a9456e82f8 /ldap/servers/slapd/back-ldbm/close.c
downloadds-b2093e3016027d6b5cf06b3f91f30769bfc099e2.tar.gz
ds-b2093e3016027d6b5cf06b3f91f30769bfc099e2.tar.xz
ds-b2093e3016027d6b5cf06b3f91f30769bfc099e2.zip
Moving NSCP Directory Server from DirectoryBranch to TRUNK, initial drop. (foxworth)ldapserver7x
Diffstat (limited to 'ldap/servers/slapd/back-ldbm/close.c')
-rw-r--r--ldap/servers/slapd/back-ldbm/close.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/ldap/servers/slapd/back-ldbm/close.c b/ldap/servers/slapd/back-ldbm/close.c
new file mode 100644
index 00000000..ce2be3b9
--- /dev/null
+++ b/ldap/servers/slapd/back-ldbm/close.c
@@ -0,0 +1,52 @@
+/** BEGIN COPYRIGHT BLOCK
+ * Copyright 2001 Sun Microsystems, Inc.
+ * Portions copyright 1999, 2001-2003 Netscape Communications Corporation.
+ * All rights reserved.
+ * END COPYRIGHT BLOCK **/
+/* close.c - close ldbm backend */
+
+#include "back-ldbm.h"
+
+int ldbm_back_close( Slapi_PBlock *pb )
+{
+ struct ldbminfo *li;
+
+ LDAPDebug( LDAP_DEBUG_TRACE, "ldbm backend syncing\n", 0, 0, 0 );
+ slapi_pblock_get( pb, SLAPI_PLUGIN_PRIVATE, &li );
+
+ /* Kill off any sleeping threads by setting this flag */
+ PR_Lock(li->li_shutdown_mutex);
+ li->li_shutdown = 1;
+ PR_Unlock(li->li_shutdown_mutex);
+
+ dblayer_flush( li ); /* just be doubly sure! */
+
+ /* close down all the ldbm instances */
+ dblayer_close( li, DBLAYER_NORMAL_MODE );
+
+ LDAPDebug( LDAP_DEBUG_TRACE, "ldbm backend done syncing\n", 0, 0, 0 );
+ return 0;
+}
+
+int ldbm_back_flush( Slapi_PBlock *pb )
+{
+ struct ldbminfo *li;
+
+ LDAPDebug( LDAP_DEBUG_TRACE, "ldbm backend flushing\n", 0, 0, 0 );
+ slapi_pblock_get( pb, SLAPI_PLUGIN_PRIVATE, &li );
+ dblayer_flush( li );
+ LDAPDebug( LDAP_DEBUG_TRACE, "ldbm backend done flushing\n", 0, 0, 0 );
+ return 0;
+}
+
+void ldbm_back_instance_set_destructor(void **arg)
+{
+ /*
+ Objset *instance_set = (Objset *) *arg;
+ */
+
+ /* This function is called when the instance set is destroyed.
+ * I can't really think of anything we should do here, but that
+ * may change in the future. */
+ LDAPDebug(LDAP_DEBUG_ANY, "Set of instances destroyed\n", 0, 0, 0);
+}