EntryInfo *c_lruhead; /* lru - add accessed entries here */
EntryInfo *c_lrutail; /* lru - rem lru entries from here */
EntryInfo c_dntree;
- int c_maxsize;
+ unsigned c_maxsize;
int c_cursize;
- int c_minfree;
- int c_eimax;
+ unsigned c_minfree;
+ unsigned c_eimax;
int c_eiused; /* EntryInfo's in use */
int c_leaves; /* EntryInfo leaf nodes */
int c_purging;
ID bi_lastid;
ldap_pvt_thread_mutex_t bi_lastid_mutex;
- int bi_idl_cache_max_size;
+ unsigned bi_idl_cache_max_size;
int bi_idl_cache_size;
Avlnode *bi_idl_tree;
bdb_idl_cache_entry_t *bi_idl_lru_head;
#define TXN_ID(txn) (txn)->locker
#endif
+/* #undef BDB_LOG_DEBUG */
+
+#ifdef BDB_LOG_DEBUG
+
/* env->log_printf appeared in 4.4 */
#if DB_VERSION_FULL >= 0x04040000
#define LOG_PRINTF(env,txn,fmt,...) (env)->log_printf((env),(txn),(fmt),__VA_ARGS__)
#define LOG_PRINTF(env,txn,fmt,...) __db_logmsg((env),(txn),"DIAGNOSTIC",0,(fmt),__VA_ARGS__)
#endif
+#else /* !BDB_LOG_DEBUG */
+
+#define LOG_PRINTF(a,b,c,...)
+
+#endif /* BDB_LOG_DEBUG */
+
#endif
#ifndef DB_BUFFER_SMALL
bdb->bi_cache.c_leaves++;
rc = avl_insert( &ei->bei_parent->bei_kids, ei2, bdb_rdn_cmp,
avl_dup_error );
-#if defined(LDAP_DEBUG) && defined(LDAP_DEVEL)
if ( rc ) {
+ /* This should never happen; entry cache is corrupt */
bdb->bi_dbenv->log_flush( bdb->bi_dbenv, NULL );
assert( !rc );
}
-#endif
#ifdef BDB_HIER
ei->bei_parent->bei_ckids++;
#endif
(ei.bei_nrdn.bv_val - ndn->bv_val);
bdb_cache_entryinfo_unlock( eip );
-#if defined(LDAP_DEBUG) && defined(LDAP_DEVEL)
LOG_PRINTF( bdb->bi_dbenv, NULL, "slapd Reading %s",
ei.bei_nrdn.bv_val );
-#endif
lock.mode = DB_LOCK_NG;
rc = bdb_dn2id( op, &ei.bei_nrdn, &ei, locker, &lock );
return rc;
}
-#if defined(LDAP_DEBUG) && defined(LDAP_DEVEL)
LOG_PRINTF( bdb->bi_dbenv, NULL, "slapd Read got %s(%d)",
ei.bei_nrdn.bv_val, ei.bei_id );
-#endif
/* DN exists but needs to be added to cache */
ei.bei_nrdn.bv_len = len;
goto return_results;
}
-#if defined(LDAP_DEBUG) && defined(LDAP_DEVEL)
LOG_PRINTF( bdb->bi_dbenv, lt2, "slapd Starting delete %s(%d)",
e->e_nname.bv_val, e->e_id );
-#endif
/* Can't do it if we have kids */
rs->sr_err = bdb_cache_children( op, lt2, e );
p = NULL;
}
-#if defined(LDAP_DEBUG) && defined(LDAP_DEVEL)
LOG_PRINTF( bdb->bi_dbenv, lt2, "slapd Commit1 delete %s(%d)",
e->e_nname.bv_val, e->e_id );
-#endif
if ( TXN_COMMIT( lt2, 0 ) != 0 ) {
rs->sr_err = LDAP_OTHER;
}
} else {
-#if defined(LDAP_DEBUG) && defined(LDAP_DEVEL)
LOG_PRINTF( bdb->bi_dbenv, ltid, "slapd Cache delete %s(%d)",
e->e_nname.bv_val, e->e_id );
-#endif
rc = bdb_cache_delete( bdb, e, locker, &lock );
switch( rc ) {
ltid = NULL;
op->o_private = NULL;
-#if defined(LDAP_DEBUG) && defined(LDAP_DEVEL)
LOG_PRINTF( bdb->bi_dbenv, NULL, "slapd Committed delete %s(%d)",
e->e_nname.bv_val, e->e_id );
-#endif
if( rs->sr_err != 0 ) {
Debug( LDAP_DEBUG_TRACE,