From: Howard Chu Date: Fri, 7 Dec 2001 05:05:00 +0000 (+0000) Subject: Bare minimum changes to support BDB 4.0 X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~726 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=66266f9c250d6ae88f19d3a1197d82ca67ecb0ca;p=openldap Bare minimum changes to support BDB 4.0 --- diff --git a/servers/slapd/back-bdb/add.c b/servers/slapd/back-bdb/add.c index 11e9527cf6..f9235b5009 100644 --- a/servers/slapd/back-bdb/add.c +++ b/servers/slapd/back-bdb/add.c @@ -299,7 +299,7 @@ return_results: if( rc == LDAP_SUCCESS && bdb->bi_txn_cp ) { ldap_pvt_thread_yield(); - txn_checkpoint( bdb->bi_dbenv, + TXN_CHECKPOINT( bdb->bi_dbenv, bdb->bi_txn_cp_kbyte, bdb->bi_txn_cp_min, 0 ); } diff --git a/servers/slapd/back-bdb/back-bdb.h b/servers/slapd/back-bdb/back-bdb.h index 97517e8b10..baa408a366 100644 --- a/servers/slapd/back-bdb/back-bdb.h +++ b/servers/slapd/back-bdb/back-bdb.h @@ -110,6 +110,14 @@ struct bdb_op_info { int boi_err; }; +#if DB_VERSION_MAJOR < 4 +#define TXN_CHECKPOINT(env, k, m, f) txn_checkpoint(env, k, m, f) +#define LOCK_DETECT(env, f, t, a) lock_detect(env, f, t, a) +#else +#define TXN_CHECKPOINT(env, k, m, f) (env)->txn_checkpoint(env, k, m, f) +#define LOCK_DETECT(env, f, t, a) (env)->lock_detect(env, f, t, a) +#endif + LDAP_END_DECL #include "proto-bdb.h" diff --git a/servers/slapd/back-bdb/delete.c b/servers/slapd/back-bdb/delete.c index 50e4206903..6b034d40d7 100644 --- a/servers/slapd/back-bdb/delete.c +++ b/servers/slapd/back-bdb/delete.c @@ -316,7 +316,7 @@ return_results: if(rc == LDAP_SUCCESS && bdb->bi_txn_cp ) { ldap_pvt_thread_yield(); - txn_checkpoint( bdb->bi_dbenv, + TXN_CHECKPOINT( bdb->bi_dbenv, bdb->bi_txn_cp_kbyte, bdb->bi_txn_cp_min, 0 ); } diff --git a/servers/slapd/back-bdb/init.c b/servers/slapd/back-bdb/init.c index 6672c3029b..d57b4a8756 100644 --- a/servers/slapd/back-bdb/init.c +++ b/servers/slapd/back-bdb/init.c @@ -87,7 +87,7 @@ static void *lock_detect_task( void *arg ) int rc; sleep( bdb->bi_lock_detect_seconds ); - rc = lock_detect( bdb->bi_dbenv, 0, + rc = LOCK_DETECT( bdb->bi_dbenv, 0, bdb->bi_lock_detect, NULL ); if( rc != 0 ) { @@ -311,7 +311,7 @@ bdb_db_destroy( BackendDB *be ) /* force a checkpoint */ if( bdb->bi_txn ) { - rc = txn_checkpoint( bdb->bi_dbenv, 0, 0, DB_FORCE ); + rc = TXN_CHECKPOINT( bdb->bi_dbenv, 0, 0, DB_FORCE ); if( rc != 0 ) { Debug( LDAP_DEBUG_ANY, "bdb_db_destroy: txn_checkpoint failed: %s (%d)\n", diff --git a/servers/slapd/back-bdb/modify.c b/servers/slapd/back-bdb/modify.c index a72be960b4..77bbc3a8ae 100644 --- a/servers/slapd/back-bdb/modify.c +++ b/servers/slapd/back-bdb/modify.c @@ -330,7 +330,7 @@ return_results: if( rc == LDAP_SUCCESS && bdb->bi_txn_cp ) { ldap_pvt_thread_yield(); - txn_checkpoint( bdb->bi_dbenv, + TXN_CHECKPOINT( bdb->bi_dbenv, bdb->bi_txn_cp_kbyte, bdb->bi_txn_cp_min, 0 ); } diff --git a/servers/slapd/back-bdb/modrdn.c b/servers/slapd/back-bdb/modrdn.c index 9f9d3be9e2..454ec68375 100644 --- a/servers/slapd/back-bdb/modrdn.c +++ b/servers/slapd/back-bdb/modrdn.c @@ -635,7 +635,7 @@ return_results: if( rc == LDAP_SUCCESS && bdb->bi_txn_cp ) { ldap_pvt_thread_yield(); - txn_checkpoint( bdb->bi_dbenv, + TXN_CHECKPOINT( bdb->bi_dbenv, bdb->bi_txn_cp_kbyte, bdb->bi_txn_cp_min, 0 ); }