]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#3978 move alock from back-bdb to slapd
authorHoward Chu <hyc@openldap.org>
Sun, 4 Sep 2005 15:21:57 +0000 (15:21 +0000)
committerHoward Chu <hyc@openldap.org>
Sun, 4 Sep 2005 15:21:57 +0000 (15:21 +0000)
servers/slapd/Makefile.in
servers/slapd/alock.c [moved from servers/slapd/back-bdb/alock.c with 99% similarity]
servers/slapd/back-bdb/Makefile.in
servers/slapd/back-bdb/alock.h [deleted file]
servers/slapd/back-hdb/Makefile.in

index 46ee8dac699793b90bffe8759556c950cb498046..003706cfa2dfc063cd8ef150cb7e792518f395be 100644 (file)
@@ -38,7 +38,7 @@ SRCS  = main.c globals.c bconfig.c config.c daemon.c \
                backglue.c backover.c ctxcsn.c ldapsync.c frontend.c \
                slapadd.c slapcat.c slapcommon.c slapdn.c slapindex.c \
                slappasswd.c slaptest.c slapauth.c slapacl.c component.c \
-               aci.c \
+               aci.c alock.c \
                $(@PLAT@_SRCS)
 
 OBJS   = main.o globals.o bconfig.o config.o daemon.o \
@@ -56,7 +56,7 @@ OBJS  = main.o globals.o bconfig.o config.o daemon.o \
                backglue.o backover.o ctxcsn.o ldapsync.o frontend.o \
                slapadd.o slapcat.o slapcommon.o slapdn.o slapindex.o \
                slappasswd.o slaptest.o slapauth.o slapacl.o component.o \
-               aci.o \
+               aci.o alock.o \
                $(@PLAT@_OBJS)
 
 LDAP_INCDIR= ../../include -I$(srcdir) -I$(srcdir)/slapi -I.
similarity index 99%
rename from servers/slapd/back-bdb/alock.c
rename to servers/slapd/alock.c
index 92fc243edccf1d417e279c7193c036412824e277..cf90f9b946bde9e70c4d0139196f96d61fe4b54d 100644 (file)
@@ -20,6 +20,9 @@
  */
 
 #include "portable.h"
+
+#if SLAPD_BDB || SLAPD_HDB
+
 #include "alock.h"
 
 #include <ac/stdlib.h>
@@ -622,3 +625,5 @@ alock_recover ( alock_info_t * info )
 
        return ALOCK_CLEAN;
 }
+
+#endif /* SLAPD_BDB || SLAPD_HDB */
index 0eeb6a75cd56ceaba58e2bc303a7943c5ebc3f24..f439138a523a89bcc42706659835b1ac117fd1eb 100644 (file)
@@ -18,14 +18,14 @@ SRCS = init.c tools.c config.c \
        extended.c referral.c operational.c \
        attr.c index.c key.c dbcache.c filterindex.c \
        dn2entry.c dn2id.c error.c id2entry.c idl.c \
-       nextid.c cache.c trans.c alock.c
+       nextid.c cache.c trans.c
 
 OBJS = init.lo tools.lo config.lo \
        add.lo bind.lo compare.lo delete.lo modify.lo modrdn.lo search.lo \
        extended.lo referral.lo operational.lo \
        attr.lo index.lo key.lo dbcache.lo filterindex.lo \
        dn2entry.lo dn2id.lo error.lo id2entry.lo idl.lo \
-       nextid.lo cache.lo trans.lo alock.lo
+       nextid.lo cache.lo trans.lo
 
 LDAP_INCDIR= ../../../include       
 LDAP_LIBDIR= ../../../libraries
diff --git a/servers/slapd/back-bdb/alock.h b/servers/slapd/back-bdb/alock.h
deleted file mode 100644 (file)
index 902077d..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/* alock.h - access lock header */
-/* $OpenLDAP$ */
-/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
- *
- * Copyright 2005 The OpenLDAP Foundation.
- * Portions Copyright 2004-2005 Symas Corporation.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted only as authorized by the OpenLDAP
- * Public License.
- *
- * A copy of this license is available in the file LICENSE in the
- * top-level directory of the distribution or, alternatively, at
- * <http://www.OpenLDAP.org/license.html>.
- */
-/* ACKNOWLEDGEMENTS:
- * This work was initially developed by Matthew Backes at Symas
- * Corporation for inclusion in OpenLDAP Software.
- */
-
-#ifndef _ALOCK_H_
-#define _ALOCK_H_
-
-#include "portable.h"
-#include <ac/time.h>
-#include <ac/unistd.h>
-
-/* environment states (all the slots together) */
-#define ALOCK_CLEAN            (0)
-#define ALOCK_RECOVER  (1)
-#define ALOCK_BUSY             (2)
-#define ALOCK_UNSTABLE (3)
-
-/* lock user types and states */
-#define ALOCK_UNLOCKED (0)
-#define ALOCK_LOCKED   (1)
-#define ALOCK_UNIQUE   (2)
-#define ALOCK_DIRTY            (3)
-
-/* constants */
-#define ALOCK_SLOT_SIZE                (1024)
-#define ALOCK_SLOT_IATTRS      (4)
-#define ALOCK_MAX_APPNAME      (ALOCK_SLOT_SIZE - 8 * ALOCK_SLOT_IATTRS)
-#define ALOCK_MAGIC                    (0x12345678)
-
-LDAP_BEGIN_DECL
-
-typedef struct alock_info {
-       int al_fd;
-       int al_slot;
-} alock_info_t;
-
-typedef struct alock_slot {
-       unsigned int al_lock;
-       time_t al_stamp;
-       pid_t al_pid;
-       char * al_appname;
-} alock_slot_t;
-
-extern int alock_open LDAP_P(( alock_info_t * info, const char * appname,
-       const char * envdir, int locktype ));
-extern int alock_scan LDAP_P(( alock_info_t * info ));
-extern int alock_close LDAP_P(( alock_info_t * info ));
-extern int alock_recover LDAP_P(( alock_info_t * info ));
-
-LDAP_END_DECL
-
-#endif
index 854e5c3b5411a3c8a9cdb5fdc39d3691a707fe08..e7fa1e7ec330d23aa30f663dc60f33d30bc6ae7e 100644 (file)
@@ -19,13 +19,13 @@ XXDIR = $(srcdir)/../back-bdb
 
 XXSRCS = init.c tools.c config.c \
        add.c bind.c compare.c delete.c modify.c modrdn.c search.c \
-       extended.c referral.c operational.c alock.c \
+       extended.c referral.c operational.c \
        attr.c index.c key.c dbcache.c filterindex.c trans.c \
        dn2entry.c dn2id.c error.c id2entry.c idl.c nextid.c cache.c
 SRCS = $(XXSRCS)
 OBJS = init.lo tools.lo config.lo \
        add.lo bind.lo compare.lo delete.lo modify.lo modrdn.lo search.lo \
-       extended.lo referral.lo operational.lo alock.lo \
+       extended.lo referral.lo operational.lo \
        attr.lo index.lo key.lo dbcache.lo filterindex.lo trans.lo \
        dn2entry.lo dn2id.lo error.lo id2entry.lo idl.lo nextid.lo cache.lo