]> 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 f3c0ec0d688a362219c98e9f32c969e3fe1e3243..4a8879d4ec11f40876794363cd70a62643f3d8eb 100644 (file)
@@ -82,15 +82,14 @@ 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 {
        int                     dbc_refcnt;
        int                     dbc_maxids;
        int                     dbc_maxindirect;
-       time_t          dbc_lastref;
        long            dbc_blksize;
        char            *dbc_name;
        LDBM            dbc_db;
@@ -132,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;
@@ -146,10 +145,18 @@ typedef  struct _bdb2_txn_head {
 #define  BDB2_DB_ID2CHILDREN_FILE   3
 #define  BDB2_DB_OC_IDX_FILE        4
 
+       /*  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;
 
 
@@ -161,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 {
@@ -178,18 +184,12 @@ 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;
        Avlnode                 *li_attrs;
        int                     li_dbcachesize;
        int                     li_dbcachewsync;
-       struct dbcache          li_dbcache[MAXDBCACHE];
-       ldap_pvt_thread_mutex_t         li_dbcache_mutex;
-       ldap_pvt_thread_cond_t          li_dbcache_cv;
 
        /*  a list of all files of the database  */
        BDB2_TXN_HEAD           li_txn_head;