]> 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 a99efa7bca1cc754f009987c8bd6d1b32bf180da..4a8879d4ec11f40876794363cd70a62643f3d8eb 100644 (file)
@@ -79,10 +79,11 @@ struct cache {
        Avlnode         *c_idtree;
        Entry           *c_lruhead;     /* lru - add accessed entries here */
        Entry           *c_lrutail;     /* lru - rem lru entries from here */
+       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 {
@@ -130,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;
@@ -144,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;
 
 
@@ -164,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 {