ctrls[num_ctrls] = 0;
-
/* check entry's schema */
rs->sr_err = entry_schema_check( op, op->oq_add.rs_e, NULL,
get_relax(op), 1, &rs->sr_text, textbuf, textlen );
}
rs->sr_err = TXN_ABORT( ltid );
ltid = NULL;
- op->o_private = NULL;
+ LDAP_SLIST_REMOVE( &op->o_extra, &opinfo.boi_oe, OpExtra, oe_next );
+ opinfo.boi_oe.oe_key = NULL;
op->o_do_not_cache = opinfo.boi_acl_cache;
if( rs->sr_err != 0 ) {
rs->sr_err = LDAP_OTHER;
locker = TXN_ID ( ltid );
- opinfo.boi_bdb = op->o_bd;
+ opinfo.boi_oe.oe_key = op->o_bd->bd_self;
opinfo.boi_txn = ltid;
opinfo.boi_err = 0;
opinfo.boi_acl_cache = op->o_do_not_cache;
- op->o_private = &opinfo;
-
+ LDAP_SLIST_INSERT_HEAD( &op->o_extra, &opinfo.boi_oe, oe_next );
+
/*
* Get the parent dn and see if the corresponding entry exists.
*/
}
ltid = NULL;
- op->o_private = NULL;
+ LDAP_SLIST_REMOVE( &op->o_extra, &opinfo.boi_oe, OpExtra, oe_next );
+ opinfo.boi_oe.oe_key = NULL;
if ( rs->sr_err != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE,
if( ltid != NULL ) {
TXN_ABORT( ltid );
}
- op->o_private = NULL;
+ if ( opinfo.boi_oe.oe_key ) {
+ LDAP_SLIST_REMOVE( &op->o_extra, &opinfo.boi_oe, OpExtra, oe_next );
+ }
if( success == LDAP_SUCCESS ) {
/* We own the entry now, and it can be purged at will
};
struct bdb_op_info {
- BackendDB* boi_bdb;
+ OpExtra boi_oe;
DB_TXN* boi_txn;
u_int32_t boi_err;
int boi_acl_cache;
0, 0, 0 );
rs->sr_err = TXN_ABORT( ltid );
ltid = NULL;
- op->o_private = NULL;
+ LDAP_SLIST_REMOVE( &op->o_extra, &opinfo.boi_oe, OpExtra, oe_next );
+ opinfo.boi_oe.oe_key = NULL;
op->o_do_not_cache = opinfo.boi_acl_cache;
if( rs->sr_err != 0 ) {
rs->sr_err = LDAP_OTHER;
locker = TXN_ID ( ltid );
- opinfo.boi_bdb = op->o_bd;
+ opinfo.boi_oe.oe_key = op->o_bd->bd_self;
opinfo.boi_txn = ltid;
opinfo.boi_err = 0;
opinfo.boi_acl_cache = op->o_do_not_cache;
- op->o_private = &opinfo;
+ LDAP_SLIST_INSERT_HEAD( &op->o_extra, &opinfo.boi_oe, oe_next );
if ( !be_issuffix( op->o_bd, &op->o_req_ndn ) ) {
dnParent( &op->o_req_ndn, &pdn );
rs->sr_err = TXN_COMMIT( ltid, 0 );
}
ltid = NULL;
- op->o_private = NULL;
+ LDAP_SLIST_REMOVE( &op->o_extra, &opinfo.boi_oe, OpExtra, oe_next );
+ opinfo.boi_oe.oe_key = NULL;
BDB_LOG_PRINTF( bdb->bi_dbenv, NULL, "slapd Committed delete %s(%d)",
e->e_nname.bv_val, e->e_id );
if( ltid != NULL ) {
TXN_ABORT( ltid );
}
- op->o_private = NULL;
+ if ( opinfo.boi_oe.oe_key ) {
+ LDAP_SLIST_REMOVE( &op->o_extra, &opinfo.boi_oe, OpExtra, oe_next );
+ }
send_ldap_result( op, rs );
slap_graduate_commit_csn( op );
int rw )
{
struct bdb_info *bdb = (struct bdb_info *) op->o_bd->be_private;
- struct bdb_op_info *boi = NULL;
+ struct bdb_op_info *boi;
+ OpExtra *oex;
/* slapMode : SLAP_SERVER_MODE, SLAP_TOOL_MODE,
SLAP_TRUNCATE_MODE, SLAP_UNDEFINED_MODE */
#endif
}
/* free entry and reader or writer lock */
- boi = (struct bdb_op_info *)op->o_private;
+ LDAP_SLIST_FOREACH( oex, &op->o_extra, oe_next ) {
+ if ( oex->oe_key == op->o_bd->bd_self ) break;
+ }
+ boi = (struct bdb_op_info *)oex;
/* lock is freed with txn */
if ( !boi || boi->boi_txn ) {
}
}
if ( !boi->boi_locks ) {
+ LDAP_SLIST_REMOVE( &op->o_extra, &boi->boi_oe, OpExtra, oe_next );
op->o_tmpfree( boi, op->o_tmpmemctx );
- op->o_private = NULL;
}
}
} else {
"=> bdb_entry_get: oc: \"%s\", at: \"%s\"\n",
oc ? oc->soc_cname.bv_val : "(null)", at_name, 0);
- if( op ) boi = (struct bdb_op_info *) op->o_private;
- if( boi != NULL && op->o_bd->be_private == boi->boi_bdb->be_private ) {
- txn = boi->boi_txn;
+ if( op ) {
+ OpExtra *oex;
+ LDAP_SLIST_FOREACH( oex, &op->o_extra, oe_next ) {
+ if ( oex->oe_key == op->o_bd->bd_self ) break;
+ }
+ boi = (struct bdb_op_info *)oex;
+ if ( boi )
+ txn = boi->boi_txn;
}
if ( txn != NULL ) {
if ( op ) {
if ( !boi ) {
boi = op->o_tmpcalloc(1,sizeof(struct bdb_op_info),op->o_tmpmemctx);
- boi->boi_bdb = op->o_bd;
- op->o_private = boi;
+ boi->boi_oe.oe_key = op->o_bd;
+ LDAP_SLIST_INSERT_HEAD( &op->o_extra, &boi->boi_oe, oe_next );
}
if ( !boi->boi_txn ) {
struct bdb_lock_info *bli;
rs->sr_err = TXN_ABORT( ltid );
ltid = NULL;
- op->o_private = NULL;
+ LDAP_SLIST_REMOVE( &op->o_extra, &opinfo.boi_oe, OpExtra, oe_next );
+ opinfo.boi_oe.oe_key = NULL;
op->o_do_not_cache = opinfo.boi_acl_cache;
if( rs->sr_err != 0 ) {
rs->sr_err = LDAP_OTHER;
locker = TXN_ID ( ltid );
- opinfo.boi_bdb = op->o_bd;
+ opinfo.boi_oe.oe_key = op->o_bd->bd_self;
opinfo.boi_txn = ltid;
opinfo.boi_err = 0;
opinfo.boi_acl_cache = op->o_do_not_cache;
- op->o_private = &opinfo;
+ LDAP_SLIST_INSERT_HEAD( &op->o_extra, &opinfo.boi_oe, oe_next );
/* get entry or ancestor */
rs->sr_err = bdb_dn2entry( op, ltid, &op->o_req_ndn, &ei, 1,
rs->sr_err = TXN_COMMIT( ltid, 0 );
}
ltid = NULL;
- op->o_private = NULL;
+ LDAP_SLIST_REMOVE( &op->o_extra, &opinfo.boi_oe, OpExtra, oe_next );
+ opinfo.boi_oe.oe_key = NULL;
if( rs->sr_err != 0 ) {
Debug( LDAP_DEBUG_TRACE,
if( ltid != NULL ) {
TXN_ABORT( ltid );
}
- op->o_private = NULL;
+ if ( opinfo.boi_oe.oe_key ) {
+ LDAP_SLIST_REMOVE( &op->o_extra, &opinfo.boi_oe, OpExtra, oe_next );
+ }
if( e != NULL ) {
bdb_unlocked_cache_return_entry_w (&bdb->bi_cache, e);
rs->sr_err = TXN_ABORT( ltid );
ltid = NULL;
- op->o_private = NULL;
+ LDAP_SLIST_REMOVE( &op->o_extra, &opinfo.boi_oe, OpExtra, oe_next );
+ opinfo.boi_oe.oe_key = NULL;
op->o_do_not_cache = opinfo.boi_acl_cache;
if( rs->sr_err != 0 ) {
rs->sr_err = LDAP_OTHER;
locker = TXN_ID ( ltid );
- opinfo.boi_bdb = op->o_bd;
+ opinfo.boi_oe.oe_key = op->o_bd->bd_self;
opinfo.boi_txn = ltid;
opinfo.boi_err = 0;
opinfo.boi_acl_cache = op->o_do_not_cache;
- op->o_private = &opinfo;
+ LDAP_SLIST_INSERT_HEAD( &op->o_extra, &opinfo.boi_oe, oe_next );
/* get entry */
rs->sr_err = bdb_dn2entry( op, ltid, &op->o_req_ndn, &ei, 1,
}
ltid = NULL;
- op->o_private = NULL;
+ LDAP_SLIST_REMOVE( &op->o_extra, &opinfo.boi_oe, OpExtra, oe_next );
+ opinfo.boi_oe.oe_key = NULL;
if( rs->sr_err != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE,
if( ltid != NULL ) {
TXN_ABORT( ltid );
}
- op->o_private = NULL;
+ if ( opinfo.boi_oe.oe_key ) {
+ LDAP_SLIST_REMOVE( &op->o_extra, &opinfo.boi_oe, OpExtra, oe_next );
+ }
if( preread_ctrl != NULL && (*preread_ctrl) != NULL ) {
slap_sl_free( (*preread_ctrl)->ldctl_value.bv_val, op->o_tmpmemctx );
DB_LOCK lock;
struct bdb_op_info *opinfo = NULL;
DB_TXN *ltid = NULL;
+ OpExtra *oex;
Debug( LDAP_DEBUG_TRACE, "=> " LDAP_XSTRING(bdb_search) "\n", 0, 0, 0);
attrs = op->oq_search.rs_attrs;
- opinfo = (struct bdb_op_info *) op->o_private;
+ LDAP_SLIST_FOREACH( oex, &op->o_extra, oe_next ) {
+ if ( oex->oe_key == (void *)op->o_bd->bd_self )
+ break;
+ }
+ opinfo = (struct bdb_op_info *) oex;
manageDSAit = get_manageDSAit( op );