Cleanup prev commits

This commit is contained in:
Howard Chu 2007-12-06 06:20:42 +00:00
parent cb0e31fc65
commit ebbb6ab216
3 changed files with 15 additions and 18 deletions

View file

@ -153,10 +153,10 @@ typedef struct bdb_cache {
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;
@ -225,7 +225,7 @@ struct bdb_info {
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;
@ -314,6 +314,10 @@ struct bdb_op_info {
#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__)
@ -323,6 +327,12 @@ extern int __db_logmsg(const DB_ENV *env, DB_TXN *txn, const char *op, u_int32_t
#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

View file

@ -358,12 +358,11 @@ bdb_entryinfo_add_internal(
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
@ -432,10 +431,8 @@ bdb_cache_find_ndn(
(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 );
@ -446,10 +443,8 @@ bdb_cache_find_ndn(
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;

View file

@ -372,10 +372,8 @@ retry: /* transaction retry */
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 );
@ -497,10 +495,8 @@ retry: /* transaction retry */
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;
@ -528,10 +524,8 @@ retry: /* transaction retry */
}
} 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 ) {
@ -545,10 +539,8 @@ retry: /* transaction retry */
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,