ei->bei_rdn.bv_val = NULL;
#endif
} else {
+ int rc;
+
bdb->bi_cache.c_eiused++;
ber_dupbv( &ei2->bei_nrdn, &ei->bei_nrdn );
*/
if ( ei->bei_parent->bei_kids || !ei->bei_parent->bei_id )
bdb->bi_cache.c_leaves++;
- avl_insert( &ei->bei_parent->bei_kids, ei2, bdb_rdn_cmp,
+ rc = avl_insert( &ei->bei_parent->bei_kids, ei2, bdb_rdn_cmp,
avl_dup_error );
+ assert( !rc );
#ifdef BDB_HIER
ei->bei_parent->bei_ckids++;
#endif
int
hdb_cache_find_parent(
Operation *op,
- DB_TXN *txn,
BDB_LOCKER locker,
ID id,
EntryInfo **res )
ei.bei_ckids = 0;
for (;;) {
- rc = hdb_dn2id_parent( op, txn, locker, &ei, &eip.bei_id );
+ rc = hdb_dn2id_parent( op, locker, &ei, &eip.bei_id );
if ( rc ) break;
/* Save the previous node, if any */
}
}
#else
- rc = hdb_cache_find_parent(op, tid, locker, id, eip );
+ rc = hdb_cache_find_parent(op, locker, id, eip );
if ( rc == 0 ) flag |= ID_LOCKED;
#endif
}
int
hdb_dn2id_parent(
Operation *op,
- DB_TXN *txn,
BDB_LOCKER locker,
EntryInfo *ei,
ID *idp )
DBTzero(&data);
data.flags = DB_DBT_USERMEM;
- rc = db->cursor( db, txn, &cursor, bdb->bi_db_opflags );
+ rc = db->cursor( db, NULL, &cursor, bdb->bi_db_opflags );
if ( rc ) return rc;
- if ( !txn && locker ) {
+ if ( locker ) {
CURSOR_SETLOCKER(cursor, locker);
}
op.o_tmpmemctx = NULL;
op.o_tmpmfuncs = &ch_mfuncs;
- rc = bdb_cache_find_parent( &op, NULL, CURSOR_GETLOCKER(cursor), id, &ei );
+ rc = bdb_cache_find_parent( &op, CURSOR_GETLOCKER(cursor), id, &ei );
if ( rc == LDAP_SUCCESS ) {
bdb_cache_entryinfo_unlock( ei );
e->e_private = ei;