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;
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;
#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;
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 {
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;