- struct slap_csn_entry *csne = NULL;
-
- if ( op == NULL )
- return;
-
- if ( op->o_bd == NULL )
- return;
-
- ldap_pvt_thread_mutex_lock( &op->o_bd->be_pcl_mutex );
-
- LDAP_TAILQ_FOREACH( csne, &op->o_bd->be_pending_csn_list, csn_link ) {
- if ( csne->opid == op->o_opid && csne->connid == op->o_connid )
+ struct slap_csn_entry *csne;
+ BackendDB *be;
+
+ if ( op == NULL ) return;
+ if ( op->o_bd == NULL ) return;
+ be = op->o_bd->bd_self;
+
+ ldap_pvt_thread_mutex_lock( &be->be_pcl_mutex );
+
+ LDAP_TAILQ_FOREACH( csne, be->be_pending_csn_list, ce_csn_link ) {
+ if ( csne->ce_opid == op->o_opid && csne->ce_connid == op->o_connid ) {
+ LDAP_TAILQ_REMOVE( be->be_pending_csn_list,
+ csne, ce_csn_link );
+ Debug( LDAP_DEBUG_SYNC, "slap_graduate_commit_csn: removing %p %s\n",
+ csne->ce_csn.bv_val, csne->ce_csn.bv_val, 0 );
+ if ( op->o_csn.bv_val == csne->ce_csn.bv_val ) {
+ BER_BVZERO( &op->o_csn );
+ }
+ ch_free( csne->ce_csn.bv_val );
+ ch_free( csne );