size_t textlen = sizeof textbuf;
AttributeDescription *children = slap_schema.si_ad_children;
AttributeDescription *entry = slap_schema.si_ad_entry;
- DB_TXN *ltid = NULL, *lt2, *rtxn;
+ DB_TXN *ltid = NULL, *lt2;
ID eid = NOID;
struct bdb_op_info opinfo = {{{ 0 }}};
int subentry;
subentry = is_entry_subentry( op->ora_e );
- /* Get our reader TXN */
- rs->sr_err = bdb_reader_get( op, bdb->bi_dbenv, &rtxn );
-
if( 0 ) {
retry: /* transaction retry */
if( p ) {
nrdn = op->ora_e->e_nname;
}
- /* Use the reader txn here, outside the add txn */
- bdb_cache_add( bdb, ei, op->ora_e, &nrdn, rtxn, &lock );
+ bdb_cache_add( bdb, ei, op->ora_e, &nrdn, ltid, &lock );
if(( rs->sr_err=TXN_COMMIT( ltid, 0 )) != 0 ) {
rs->sr_text = "txn_commit failed";
* Possibly a callback may have mucked with it, although
* in general callbacks should treat the entry as read-only.
*/
- bdb_cache_return_entry_r( bdb, oe, &lock );
+ bdb_cache_deref( oe->e_private );
if ( op->ora_e == oe )
op->ora_e = NULL;
ei.bei_nrdn = *nrdn;
ei.bei_lockpad = 0;
+#if 0
/* Lock this entry so that bdb_add can run to completion.
* It can only fail if BDB has run out of lock resources.
*/
bdb_cache_entryinfo_unlock( eip );
return rc;
}
+#endif
#ifdef BDB_HIER
if ( nrdn->bv_len != e->e_nname.bv_len ) {
}
ldap_pvt_thread_mutex_unlock( &bdb->bi_cache.c_count_mutex );
+ new->bei_finders = 1;
bdb_cache_lru_link( bdb, new );
if ( purge )
return rc;
}
+int bdb_cache_deref(
+ EntryInfo *ei
+ )
+{
+ bdb_cache_entryinfo_lock( ei );
+ ei->bei_finders--;
+ bdb_cache_entryinfo_unlock( ei );
+}
+
int
bdb_cache_modify(
struct bdb_info *bdb,
#define bdb_cache_modrdn BDB_SYMBOL(cache_modrdn)
#define bdb_cache_release_all BDB_SYMBOL(cache_release_all)
#define bdb_cache_delete_entry BDB_SYMBOL(cache_delete_entry)
+#define bdb_cache_deref BDB_SYMBOL(cache_deref)
int bdb_cache_children(
Operation *op,
EntryInfo *ei
);
void bdb_cache_release_all( Cache *cache );
+void bdb_cache_deref( EntryInfo *ei );
#ifdef BDB_HIER
int hdb_cache_load(