From: Howard Chu Date: Wed, 4 Nov 2009 06:09:51 +0000 (+0000) Subject: Clean up prev commit X-Git-Tag: ACLCHECK_0~145 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f685d9e78b86f4d735e68a47f9913f34d04cc901;p=openldap Clean up prev commit --- diff --git a/servers/slapd/back-bdb/cache.c b/servers/slapd/back-bdb/cache.c index be80a22b2b..4e5636f73b 100644 --- a/servers/slapd/back-bdb/cache.c +++ b/servers/slapd/back-bdb/cache.c @@ -1072,18 +1072,20 @@ load1: if ( rc == 0 ) { int purge = 0; - ldap_pvt_thread_mutex_lock( &bdb->bi_cache.c_count_mutex ); - if ( load && !( flag & ID_NOCACHE )) { - bdb->bi_cache.c_cursize++; - if ( !bdb->bi_cache.c_purging && bdb->bi_cache.c_cursize > bdb->bi_cache.c_maxsize ) { + if (( load && !( flag & ID_NOCACHE )) || bdb->bi_cache.c_eimax ) { + ldap_pvt_thread_mutex_lock( &bdb->bi_cache.c_count_mutex ); + if ( load && !( flag & ID_NOCACHE )) { + bdb->bi_cache.c_cursize++; + if ( !bdb->bi_cache.c_purging && bdb->bi_cache.c_cursize > bdb->bi_cache.c_maxsize ) { + purge = 1; + bdb->bi_cache.c_purging = 1; + } + } else if ( !bdb->bi_cache.c_purging && bdb->bi_cache.c_eimax && bdb->bi_cache.c_leaves > bdb->bi_cache.c_eimax ) { purge = 1; bdb->bi_cache.c_purging = 1; } - } else if ( !bdb->bi_cache.c_purging && bdb->bi_cache.c_eimax && bdb->bi_cache.c_leaves > bdb->bi_cache.c_eimax ) { - purge = 1; - bdb->bi_cache.c_purging = 1; + ldap_pvt_thread_mutex_unlock( &bdb->bi_cache.c_count_mutex ); } - ldap_pvt_thread_mutex_unlock( &bdb->bi_cache.c_count_mutex ); if ( purge ) bdb_cache_lru_purge( bdb ); }