]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-bdb2/back-bdb2.h
Change 'unsigned long len' to ber_len_t in get_filter()
[openldap] / servers / slapd / back-bdb2 / back-bdb2.h
index 126c2fb6ce4256bcb536f67aa43c39f6ec3f2d40..4a8879d4ec11f40876794363cd70a62643f3d8eb 100644 (file)
@@ -82,8 +82,8 @@ struct cache {
        ldap_pvt_thread_mutex_t c_mutex;
 };
 
-#define CACHE_READ_LOCK                1
-#define CACHE_WRITE_LOCK       2
+#define CACHE_READ_LOCK                0
+#define CACHE_WRITE_LOCK       1
 
 /* for the cache of open index files (re-used for txn) */
 struct dbcache {
@@ -131,9 +131,9 @@ struct attrinfo {
 
 typedef  struct _bdb2_txn_head {
 
-       /*  counter and timer to control checkpoints  */
-       size_t           txn_cnt;
-       time_t           txn_chkp;
+       /*  log size and timer to control checkpoints  */
+       u_int32_t        txn_log;
+       u_int32_t        txn_time;
 
        /*  a list of all DB files in use  */
        BDB2_TXN_FILES   *dbFiles;
@@ -145,15 +145,18 @@ typedef  struct _bdb2_txn_head {
 #define  BDB2_DB_ID2CHILDREN_FILE   3
 #define  BDB2_DB_OC_IDX_FILE        4
 
-       /*  a file pointer for the NEXTID file
-               (must be opened appropriately at backend
-               entry and closed on leave  */
-       FILE             *nextidFP;
+       /*  a database handle for the NEXTID file
+               (must be opened like all DB files at startup
+               and closed on shutdown  */
+       LDBM             nextidFile;
 
        /*  is the default attribute index set to non-none  */
        int              withDefIDX;
 #define  BDB2_WITH_DEF_IDX          1
 
+       /*  a handle for the backend's environment  */
+       DB_ENV           **dbenvH;
+
 } BDB2_TXN_HEAD;
 
 
@@ -165,15 +168,14 @@ struct ldbtype {
        char                    *lty_dbhome;
        size_t                  lty_mpsize;
        int                             lty_betiming;
-
-       /*  XXX do we need a private DB_ENV for all DB2 backend types ?  */
-       DB_ENV                  *lty_dbenv;
 };
 
-#define get_dbenv(be) ((struct ldbtype *) (be)->bd_info->bi_private)->lty_dbenv
 #define with_timing(bi) (((struct ldbtype *) \
                        (bi)->bi_private)->lty_betiming == 1)
 
+/*  The DB environment  */
+extern DB_ENV       bdb2i_dbEnv;
+
 
 /*  the private description of a database  */
 struct ldbminfo {
@@ -182,9 +184,6 @@ struct ldbminfo {
        ID                      li_nextid_wrote;
 #endif
        char            *li_nextid_file;
-       ldap_pvt_thread_mutex_t         li_root_mutex;
-       ldap_pvt_thread_mutex_t         li_add_mutex;
-       ldap_pvt_thread_mutex_t         li_nextid_mutex;
        int                     li_mode;
        char                    *li_directory;
        struct cache            li_cache;