diff options
author | Rich Megginson <rmeggins@redhat.com> | 2007-02-12 21:13:07 +0000 |
---|---|---|
committer | Rich Megginson <rmeggins@redhat.com> | 2007-02-12 21:13:07 +0000 |
commit | c7812a234be1eb4a098cf93a50f6dd91f571235c (patch) | |
tree | 00a78bf73dda13a0aa6e20a71c5a8de716b6d6b1 | |
parent | ebed5efa09b77c7b5c655c9578bcd1329ab85409 (diff) | |
download | ds-c7812a234be1eb4a098cf93a50f6dd91f571235c.tar.gz ds-c7812a234be1eb4a098cf93a50f6dd91f571235c.tar.xz ds-c7812a234be1eb4a098cf93a50f6dd91f571235c.zip |
Resolves: bug 228334
Bug Description: Allow building with bdb 4.4 or later
Reviewed by: nkinder (Thanks!)
Fix Description: db.m4 already had code to detect and use the correct version of db headers and libraries. There have been some minor api changes since 4.3, so not much code changes were required. Note that this merely allows the server to build and run with db4.4 or later, not to take advantage of the newer features of the API.
Platforms tested: FC7
Flag Day: no
Doc impact: no
-rw-r--r-- | ldap/servers/plugins/replication/cl5_api.c | 9 | ||||
-rw-r--r-- | ldap/servers/slapd/back-ldbm/dblayer.c | 10 | ||||
-rw-r--r-- | ldap/servers/slapd/back-ldbm/perfctrs.c | 10 |
3 files changed, 22 insertions, 7 deletions
diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c index f163dcfa..0897ff0b 100644 --- a/ldap/servers/plugins/replication/cl5_api.c +++ b/ldap/servers/plugins/replication/cl5_api.c @@ -112,8 +112,6 @@ #if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 4000 #define DB_ENV_SET_REGION_INIT(env) (env)->set_flags((env), DB_REGION_INIT, 1) -#define DB_ENV_SET_TAS_SPINS(env, tas_spins) \ - (env)->set_tas_spins((env), (tas_spins)) #define TXN_BEGIN(env, parent_txn, tid, flags) \ (env)->txn_begin((env), (parent_txn), (tid), (flags)) #define TXN_COMMIT(txn, flags) (txn)->commit((txn), (flags)) @@ -129,6 +127,13 @@ #define LOG_FLUSH(env, lsn) (env)->log_flush((env), (lsn)) #define LOCK_DETECT(env, flags, atype, aborted) \ (env)->lock_detect((env), (flags), (atype), (aborted)) +#if DB_VERSION_MINOR >= 4 /* i.e. 4.4 or later */ +#define DB_ENV_SET_TAS_SPINS(env, tas_spins) \ + (env)->mutex_set_tas_spins((env), (tas_spins)) +#else /* < 4.4 */ +#define DB_ENV_SET_TAS_SPINS(env, tas_spins) \ + (env)->set_tas_spins((env), (tas_spins)) +#endif /* 4.4 or later */ #else /* older than db 4.0 */ #define DB_ENV_SET_REGION_INIT(env) db_env_set_region_init(1) diff --git a/ldap/servers/slapd/back-ldbm/dblayer.c b/ldap/servers/slapd/back-ldbm/dblayer.c index 89798be0..8c066d9b 100644 --- a/ldap/servers/slapd/back-ldbm/dblayer.c +++ b/ldap/servers/slapd/back-ldbm/dblayer.c @@ -122,8 +122,6 @@ #if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 4000 #define DB_ENV_SET_REGION_INIT(env) (env)->set_flags((env), DB_REGION_INIT, 1) -#define DB_ENV_SET_TAS_SPINS(env, tas_spins) \ - (env)->set_tas_spins((env), (tas_spins)) #define TXN_BEGIN(env, parent_txn, tid, flags) \ (env)->txn_begin((env), (parent_txn), (tid), (flags)) #define TXN_COMMIT(txn, flags) (txn)->commit((txn), (flags)) @@ -139,7 +137,13 @@ #define LOG_FLUSH(env, lsn) (env)->log_flush((env), (lsn)) #define LOCK_DETECT(env, flags, atype, aborted) \ (env)->lock_detect((env), (flags), (atype), (aborted)) - +#if DB_VERSION_MINOR >= 4 /* i.e. 4.4 or later */ +#define DB_ENV_SET_TAS_SPINS(env, tas_spins) \ + (env)->mutex_set_tas_spins((env), (tas_spins)) +#else /* < 4.4 */ +#define DB_ENV_SET_TAS_SPINS(env, tas_spins) \ + (env)->set_tas_spins((env), (tas_spins)) +#endif /* 4.4 or later */ #else /* older than db 4.0 */ #define DB_ENV_SET_REGION_INIT(env) db_env_set_region_init(1) #define DB_ENV_SET_TAS_SPINS(env, tas_spins) \ diff --git a/ldap/servers/slapd/back-ldbm/perfctrs.c b/ldap/servers/slapd/back-ldbm/perfctrs.c index be7450d2..21ca5e5d 100644 --- a/ldap/servers/slapd/back-ldbm/perfctrs.c +++ b/ldap/servers/slapd/back-ldbm/perfctrs.c @@ -53,6 +53,11 @@ #define LOG_STAT(env, spp, flags, malloc) (env)->log_stat((env), (spp), (flags)) #define LOCK_STAT(env, statp, flags, malloc) \ (env)->lock_stat((env), (statp), (flags)) +#if DB_VERSION_MINOR >= 4 /* i.e. 4.4 or later */ +#define GET_N_LOCK_WAITS(lockstat) lockstat->st_lock_wait +#else +#define GET_N_LOCK_WAITS(lockstat) lockstat->st_nconflicts +#endif #else /* older than db 4.0 */ #if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 3300 @@ -60,13 +65,14 @@ #define MEMP_STAT(env, gsp, fsp, flags, malloc) memp_stat((env), (gsp), (fsp)) #define LOG_STAT(env, spp, flags, malloc) log_stat((env), (spp)) #define LOCK_STAT(env, statp, flags, malloc) lock_stat((env), (statp)) - +#define GET_N_LOCK_WAITS(lockstat) lockstat->st_nconflicts #else /* older than db 3.3 */ #define TXN_STAT(env, statp, flags, malloc) txn_stat((env), (statp), (malloc)) #define MEMP_STAT(env, gsp, fsp, flags, malloc) memp_stat((env), (gsp), (fsp), (malloc)) #define LOG_STAT(env, spp, flags, malloc) log_stat((env), (spp), (malloc)) #define LOCK_STAT(env, statp, flags, malloc) lock_stat((env), (statp), (malloc)) +#define GET_N_LOCK_WAITS(lockstat) lockstat->st_nconflicts #endif #endif @@ -312,7 +318,7 @@ void perfctrs_update(perfctrs_private *priv, DB_ENV *db_env) perf->current_locks = lockstat->st_nlocks; perf->max_locks = lockstat->st_maxnlocks; perf->lockers = lockstat->st_nlockers; - perf->lock_conflicts = lockstat->st_nconflicts; + perf->lock_conflicts = GET_N_LOCK_WAITS(lockstat); perf->lock_request_rate = lockstat->st_nrequests; perf->current_lock_objects = lockstat->st_nobjects; perf->max_lock_objects = lockstat->st_maxnobjects; |