mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-03-07 14:18:15 +08:00
ITS#2541 added bdb_cache_delete_cleanup() to defer cache delete.
This commit is contained in:
parent
505838469d
commit
2bb9a15d57
@ -817,11 +817,19 @@ bdb_cache_delete(
|
||||
/* free cache write lock */
|
||||
ldap_pvt_thread_rdwr_wunlock( &cache->c_rwlock );
|
||||
bdb_cache_entryinfo_unlock( ei->bei_parent );
|
||||
bdb_cache_entryinfo_destroy( ei );
|
||||
e->e_private = NULL;
|
||||
return( rc );
|
||||
}
|
||||
|
||||
void
|
||||
bdb_cache_delete_cleanup(
|
||||
Entry *e
|
||||
)
|
||||
{
|
||||
bdb_cache_entryinfo_destroy( e->e_private );
|
||||
e->e_private = NULL;
|
||||
bdb_entry_return( e );
|
||||
}
|
||||
|
||||
static int
|
||||
bdb_cache_delete_internal(
|
||||
Cache *cache,
|
||||
|
@ -488,11 +488,9 @@ return_results:
|
||||
|
||||
#if defined(LDAP_CLIENT_UPDATE) || defined(LDAP_SYNC)
|
||||
if ( rs->sr_err == LDAP_SUCCESS && !noop ) {
|
||||
BEI(e) = eip;
|
||||
LDAP_LIST_FOREACH( ps_list, &bdb->bi_psearch_list, o_ps_link ) {
|
||||
bdb_psearch( op, rs, ps_list, e, LDAP_PSEARCH_BY_DELETE );
|
||||
}
|
||||
BEI(e) = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -506,7 +504,8 @@ done:
|
||||
/* free entry */
|
||||
if( e != NULL ) {
|
||||
if ( rs->sr_err == LDAP_SUCCESS ) {
|
||||
bdb_entry_return( e );
|
||||
/* Free the EntryInfo and the Entry */
|
||||
bdb_cache_delete_cleanup( e );
|
||||
} else {
|
||||
bdb_unlocked_cache_return_entry_w(&bdb->bi_cache, e);
|
||||
}
|
||||
|
@ -408,6 +408,7 @@ void bdb_unlocked_cache_return_entry_rw( Cache *cache, Entry *e, int rw );
|
||||
#define bdb_cache_add BDB_SYMBOL(cache_add)
|
||||
#define bdb_cache_children BDB_SYMBOL(cache_children)
|
||||
#define bdb_cache_delete BDB_SYMBOL(cache_delete)
|
||||
#define bdb_cache_delete_cleanup BDB_SYMBOL(cache_delete_cleanup)
|
||||
#define bdb_cache_find_id BDB_SYMBOL(cache_find_id)
|
||||
#define bdb_cache_find_ndn BDB_SYMBOL(cache_find_ndn)
|
||||
#define bdb_cache_modify BDB_SYMBOL(cache_modify)
|
||||
@ -467,6 +468,9 @@ int bdb_cache_delete(
|
||||
u_int32_t locker,
|
||||
DB_LOCK *lock
|
||||
);
|
||||
void bdb_cache_delete_cleanup(
|
||||
Entry *e
|
||||
);
|
||||
void bdb_cache_release_all( Cache *cache );
|
||||
|
||||
#ifdef BDB_REUSE_LOCKERS
|
||||
|
Loading…
Reference in New Issue
Block a user