return 0;
}
#endif
+
+void
+bdb_cache_delete_entry(
+ struct bdb_info *bdb,
+ EntryInfo *ei,
+ u_int32_t locker,
+ DB_LOCK *lock )
+{
+ ldap_pvt_thread_rdwr_wlock( &bdb->bi_cache.c_rwlock );
+ if ( bdb_cache_entry_db_lock( bdb->bi_dbenv, locker, ei, 1, 1, &lock ) == 0 ) {
+ if ( ei->bei_e && !(ei->bei_state & CACHE_ENTRY_NOT_LINKED )) {
+ LRU_DELETE( &bdb->bi_cache, ei );
+ ei->bei_e->e_private = NULL;
+ bdb_entry_return( ei->bei_e );
+ ei->bei_e = NULL;
+ --bdb->bi_cache.c_cursize;
+ }
+ bdb_cache_entry_db_unlock( bdb->bi_dbenv, &lock );
+ }
+ ldap_pvt_thread_rdwr_wunlock( &bdb->bi_cache.c_rwlock );
+}
#define bdb_cache_modify BDB_SYMBOL(cache_modify)
#define bdb_cache_modrdn BDB_SYMBOL(cache_modrdn)
#define bdb_cache_release_all BDB_SYMBOL(cache_release_all)
+#define bdb_cache_delete_entry BDB_SYMBOL(cache_delete_entry)
int bdb_cache_children(
Operation *op,
Entry *e
);
void bdb_cache_release_all( Cache *cache );
+void bdb_cache_delete_entry(
+ struct bdb_info *bdb,
+ EntryInfo *ei,
+ u_int32_t locker,
+ DB_LOCK *lock
+);
#ifdef BDB_HIER
int hdb_cache_load(
/* free reader lock */
if (!IS_PSEARCH) {
bdb_cache_return_entry_r( bdb->bi_dbenv,
- &bdb->bi_cache, e , &lock);
+ &bdb->bi_cache, e , &lock );
+ if ( sop->o_nocaching ) {
+ bdb_cache_delete_entry( bdb, ei, locker, &lock );
+ }
}
e = NULL;
rs->sr_entry = NULL;