fix opinfo

This commit is contained in:
Howard Chu 2011-08-26 01:24:06 -07:00
parent 8a6b9ea1a3
commit 5d60046801
5 changed files with 10 additions and 40 deletions

View file

@ -135,15 +135,9 @@ mdb_bind( Operation *op, SlapReply *rs )
}
done:
moi->moi_ref--;
if ( moi->moi_ref < 1 ) {
if ( moi->moi_flag & MOI_READER ) {
mdb_txn_reset( moi->moi_txn );
} /* writers can abort themselves */
if ( moi == &opinfo ) {
mdb_txn_reset( moi->moi_txn );
LDAP_SLIST_REMOVE( &op->o_extra, &moi->moi_oe, OpExtra, oe_next );
if ( moi->moi_flag & MOI_FREEIT ) {
op->o_tmpfree( moi, op->o_tmpmemctx );
}
}
/* free entry and reader lock */
if( e != NULL ) {

View file

@ -123,15 +123,9 @@ return_results:
}
done:
moi->moi_ref--;
if ( moi->moi_ref < 1 ) {
if ( moi->moi_flag & MOI_READER ) {
mdb_txn_reset( moi->moi_txn );
} /* writers can abort themselves */
if ( moi == &opinfo ) {
mdb_txn_reset( moi->moi_txn );
LDAP_SLIST_REMOVE( &op->o_extra, &moi->moi_oe, OpExtra, oe_next );
if ( moi->moi_flag & MOI_FREEIT ) {
op->o_tmpfree( moi, op->o_tmpmemctx );
}
}
/* free entry */
if ( e != NULL ) {

View file

@ -73,15 +73,9 @@ mdb_hasSubordinates(
}
done:;
moi->moi_ref--;
if ( moi->moi_ref < 1 ) {
if ( moi->moi_flag & MOI_READER ) {
mdb_txn_reset( moi->moi_txn );
} /* writers can abort themselves */
if ( moi == &opinfo ) {
mdb_txn_reset( moi->moi_txn );
LDAP_SLIST_REMOVE( &op->o_extra, &moi->moi_oe, OpExtra, oe_next );
if ( moi->moi_flag & MOI_FREEIT ) {
op->o_tmpfree( moi, op->o_tmpmemctx );
}
}
return rc;
}

View file

@ -139,15 +139,9 @@ mdb_referrals( Operation *op, SlapReply *rs )
}
done:
moi->moi_ref--;
if ( moi->moi_ref < 1 ) {
if ( moi->moi_flag & MOI_READER ) {
mdb_txn_reset( moi->moi_txn );
} /* writers can abort themselves */
if ( moi == &opinfo ) {
mdb_txn_reset( moi->moi_txn );
LDAP_SLIST_REMOVE( &op->o_extra, &moi->moi_oe, OpExtra, oe_next );
if ( moi->moi_flag & MOI_FREEIT ) {
op->o_tmpfree( moi, op->o_tmpmemctx );
}
}
if ( e )
mdb_entry_return( e );

View file

@ -815,15 +815,9 @@ nochange:
rs->sr_err = LDAP_SUCCESS;
done:
moi->moi_ref--;
if ( moi->moi_ref < 1 ) {
if ( moi->moi_flag & MOI_READER ) {
mdb_txn_reset( moi->moi_txn );
} /* writers can abort themselves */
if ( moi == &opinfo ) {
mdb_txn_reset( moi->moi_txn );
LDAP_SLIST_REMOVE( &op->o_extra, &moi->moi_oe, OpExtra, oe_next );
if ( moi->moi_flag & MOI_FREEIT ) {
op->o_tmpfree( moi, op->o_tmpmemctx );
}
}
if( idcursor )
mdb_cursor_close( idcursor );