mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
Delete unused be_context_csn, cleanup pending csn entry
This commit is contained in:
parent
e14322dcbf
commit
fc9b1b7aca
@ -183,8 +183,6 @@ int backend_startup_one(Backend *be)
|
||||
|
||||
be->be_pending_csn_list = (struct be_pcl *)
|
||||
ch_calloc( 1, sizeof( struct be_pcl ));
|
||||
build_new_dn( &be->be_context_csn, be->be_nsuffix,
|
||||
(struct berval *)&slap_ldapsync_cn_bv, NULL );
|
||||
|
||||
LDAP_TAILQ_INIT( be->be_pending_csn_list );
|
||||
|
||||
@ -406,8 +404,7 @@ int backend_destroy(void)
|
||||
struct slap_csn_entry *tmp_csne = csne;
|
||||
|
||||
LDAP_TAILQ_REMOVE( bd->be_pending_csn_list, csne, ce_csn_link );
|
||||
ch_free( csne->ce_csn->bv_val );
|
||||
ch_free( csne->ce_csn );
|
||||
ch_free( csne->ce_csn.bv_val );
|
||||
csne = LDAP_TAILQ_NEXT( csne, ce_csn_link );
|
||||
ch_free( tmp_csne );
|
||||
}
|
||||
@ -421,7 +418,6 @@ int backend_destroy(void)
|
||||
if ( bd->be_rootdn.bv_val ) free( bd->be_rootdn.bv_val );
|
||||
if ( bd->be_rootndn.bv_val ) free( bd->be_rootndn.bv_val );
|
||||
if ( bd->be_rootpw.bv_val ) free( bd->be_rootpw.bv_val );
|
||||
if ( bd->be_context_csn.bv_val ) free( bd->be_context_csn.bv_val );
|
||||
acl_destroy( bd->be_acl, frontendDB->be_acl );
|
||||
}
|
||||
free( backendDB );
|
||||
@ -514,8 +510,6 @@ backend_db_init(
|
||||
be->be_requires = frontendDB->be_requires;
|
||||
be->be_ssf_set = frontendDB->be_ssf_set;
|
||||
|
||||
be->be_context_csn.bv_len = 0;
|
||||
be->be_context_csn.bv_val = NULL;
|
||||
be->be_pcl_mutexp = &be->be_pcl_mutex;
|
||||
ldap_pvt_thread_mutex_init( be->be_pcl_mutexp );
|
||||
|
||||
|
@ -52,7 +52,7 @@ slap_get_commit_csn( Operation *op, struct berval *csn )
|
||||
if ( csne->ce_state == SLAP_CSN_PENDING ) break;
|
||||
}
|
||||
|
||||
if ( committed_csne ) ber_dupbv_x( csn, committed_csne->ce_csn, op->o_tmpmemctx );
|
||||
if ( committed_csne ) ber_dupbv_x( csn, &committed_csne->ce_csn, op->o_tmpmemctx );
|
||||
ldap_pvt_thread_mutex_unlock( op->o_bd->be_pcl_mutexp );
|
||||
}
|
||||
|
||||
@ -87,8 +87,7 @@ slap_graduate_commit_csn( Operation *op )
|
||||
if ( csne->ce_opid == op->o_opid && csne->ce_connid == op->o_connid ) {
|
||||
LDAP_TAILQ_REMOVE( op->o_bd->be_pending_csn_list,
|
||||
csne, ce_csn_link );
|
||||
ch_free( csne->ce_csn->bv_val );
|
||||
ch_free( csne->ce_csn );
|
||||
ch_free( csne->ce_csn.bv_val );
|
||||
ch_free( csne );
|
||||
break;
|
||||
}
|
||||
@ -151,7 +150,7 @@ slap_queue_csn(
|
||||
sizeof( struct slap_csn_entry ));
|
||||
ldap_pvt_thread_mutex_lock( op->o_bd->be_pcl_mutexp );
|
||||
|
||||
pending->ce_csn = ber_dupbv( NULL, csn );
|
||||
ber_dupbv( &pending->ce_csn, csn );
|
||||
pending->ce_connid = op->o_connid;
|
||||
pending->ce_opid = op->o_opid;
|
||||
pending->ce_state = SLAP_CSN_PENDING;
|
||||
|
@ -1668,7 +1668,6 @@ struct slap_backend_db {
|
||||
struct be_pcl *be_pending_csn_list;
|
||||
ldap_pvt_thread_mutex_t be_pcl_mutex;
|
||||
ldap_pvt_thread_mutex_t *be_pcl_mutexp;
|
||||
struct berval be_context_csn;
|
||||
LDAP_STAILQ_HEAD( be_si, syncinfo_s ) be_syncinfo; /* For syncrepl */
|
||||
|
||||
char *be_realm;
|
||||
@ -2086,7 +2085,7 @@ struct slap_session_entry {
|
||||
};
|
||||
|
||||
struct slap_csn_entry {
|
||||
struct berval *ce_csn;
|
||||
struct berval ce_csn;
|
||||
unsigned long ce_opid;
|
||||
unsigned long ce_connid;
|
||||
#define SLAP_CSN_PENDING 1
|
||||
|
Loading…
Reference in New Issue
Block a user