From: Howard Chu Date: Mon, 6 Dec 2004 23:17:58 +0000 (+0000) Subject: Delete unused be_context_csn, cleanup pending csn entry X-Git-Tag: OPENLDAP_REL_ENG_2_3_0ALPHA~111 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=fc9b1b7aca945e71af0b8e9cd1b84ce8730b1574;p=openldap Delete unused be_context_csn, cleanup pending csn entry --- diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index 322f4c6f48..d04e0041a8 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -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 ); diff --git a/servers/slapd/ctxcsn.c b/servers/slapd/ctxcsn.c index 340f21db4b..9cb08328fd 100644 --- a/servers/slapd/ctxcsn.c +++ b/servers/slapd/ctxcsn.c @@ -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; diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 3b917b1e63..4338207932 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -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