[Fedora-directory-commits] ldapserver/ldap/servers/slapd/back-ldbm dblayer.c, 1.16, 1.17 perfctrs.c, 1.5, 1.6

Richard Allen Megginson (rmeggins) fedora-directory-commits at redhat.com
Mon Feb 12 21:13:15 UTC 2007


Author: rmeggins

Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv29096/ldapserver/ldap/servers/slapd/back-ldbm

Modified Files:
	dblayer.c perfctrs.c 
Log Message:
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



Index: dblayer.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/dblayer.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- dblayer.c	2 Dec 2006 00:14:25 -0000	1.16
+++ dblayer.c	12 Feb 2007 21:13:07 -0000	1.17
@@ -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) \


Index: perfctrs.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/perfctrs.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- perfctrs.c	10 Nov 2006 23:45:39 -0000	1.5
+++ perfctrs.c	12 Feb 2007 21:13:07 -0000	1.6
@@ -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 @@
 			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;




More information about the Fedora-directory-commits mailing list