Lines Matching defs:moi
555 struct mdb_op_info *moi = NULL;
567 moi = (mdb_op_info *)oex;
569 if (( moi->moi_flag & (MOI_FREEIT|MOI_KEEPER)) == MOI_FREEIT ) {
570 moi->moi_ref--;
571 if ( moi->moi_ref < 1 ) {
572 mdb_txn_reset( moi->moi_txn );
573 moi->moi_ref = 0;
574 LDAP_SLIST_REMOVE( &op->o_extra, &moi->moi_oe, OpExtra, oe_next );
575 op->o_tmpfree( moi, op->o_tmpmemctx );
600 struct mdb_op_info *moi = NULL;
612 rc = mdb_opinfo_get( op, mdb, rw == 0, &moi );
615 txn = moi->moi_txn;
698 mdb_op_info *moi = NULL;
716 moi = (mdb_op_info *)oex;
719 if ( !moi ) {
720 moi = *moip;
722 if ( !moi ) {
724 moi = op->o_tmpalloc(sizeof(struct mdb_op_info),op->o_tmpmemctx);
726 moi = ch_malloc(sizeof(mdb_op_info));
728 moi->moi_flag = MOI_FREEIT;
729 *moip = moi;
731 LDAP_SLIST_INSERT_HEAD( &op->o_extra, &moi->moi_oe, oe_next );
732 moi->moi_oe.oe_key = mdb;
733 moi->moi_ref = 0;
734 moi->moi_txn = NULL;
739 if ( moi->moi_flag & MOI_READER ) {
740 moi = *moip;
741 LDAP_SLIST_INSERT_HEAD( &op->o_extra, &moi->moi_oe, oe_next );
744 *moip = moi;
746 moi->moi_ref++;
747 if ( !moi->moi_txn ) {
749 moi->moi_txn = mdb_tool_txn;
756 rc = mdb_txn_begin( mdb->mi_dbenv, NULL, flag, &moi->moi_txn );
768 if ( !moi->moi_txn ) {
770 moi->moi_txn = mdb_tool_txn;
775 rc = mdb_txn_begin( mdb->mi_dbenv, NULL, MDB_RDONLY, &moi->moi_txn );
783 rc = mdb_txn_begin( mdb->mi_dbenv, NULL, MDB_RDONLY, &moi->moi_txn );
789 data = moi->moi_txn;
792 mdb_txn_abort( moi->moi_txn );
793 moi->moi_txn = NULL;
799 moi->moi_txn = data;
802 moi->moi_flag |= MOI_READER;
805 if ( moi->moi_ref < 1 ) {
806 moi->moi_ref = 0;
809 rc = mdb_txn_renew( moi->moi_txn );
812 moi->moi_ref++;
813 if ( *moip != moi )
814 *moip = moi;
822 mdb_op_info **moip = (mdb_op_info **)ptr, *moi = *moip;
829 moi = *moip;
830 moi->moi_flag |= MOI_KEEPER;
834 rc = mdb_txn_commit( moi->moi_txn );
837 op->o_tmpfree( moi, op->o_tmpmemctx );
841 mdb_txn_abort( moi->moi_txn );
842 op->o_tmpfree( moi, op->o_tmpmemctx );