mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
do not cache internal search results for present entry priming
This commit is contained in:
parent
d5823fa912
commit
eee84463c0
@ -1078,3 +1078,24 @@ bdb_locker_id( Operation *op, DB_ENV *env, int *locker )
|
||||
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 );
|
||||
}
|
||||
|
@ -423,6 +423,7 @@ void bdb_unlocked_cache_return_entry_rw( Cache *cache, Entry *e, int rw );
|
||||
#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,
|
||||
@ -478,6 +479,12 @@ void bdb_cache_delete_cleanup(
|
||||
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(
|
||||
|
@ -1218,7 +1218,10 @@ loop_continue:
|
||||
/* 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;
|
||||
|
Loading…
Reference in New Issue
Block a user