refs = is_entry_referral( matched )
? get_entry_referrals( be, conn, op, matched )
: NULL;
- bdb_cache_return_entry_r(bdb->bi_dbenv, &bdb->bi_cache, matched, &lock);
+ bdb_unlocked_cache_return_entry_r( &bdb->bi_cache, matched );
matched = NULL;
} else {
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
/* free parent and reader lock */
- bdb_cache_return_entry_r( bdb->bi_dbenv, &bdb->bi_cache, p, &lock );
+ bdb_unlocked_cache_return_entry_r( &bdb->bi_cache, p );
p = NULL;
goto retry;
}
matched_dn, NULL, refs, NULL );
ber_bvarray_free( refs );
- bdb_cache_return_entry_r( bdb->bi_dbenv, &bdb->bi_cache, p, &lock );
+ bdb_unlocked_cache_return_entry_r( &bdb->bi_cache, p );
p = NULL;
goto done;
}
#endif
/* free parent and reader lock */
- bdb_cache_return_entry_r( bdb->bi_dbenv, &bdb->bi_cache, p, &lock );
+ bdb_unlocked_cache_return_entry_r( &bdb->bi_cache, p );
p = NULL;
} else {
#ifdef NEW_LOGGING
LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
- "bdb_cache_return_entry_rw: return (%ld):%s, refcnt=%d\n",
+ "bdb_unlocked_cache_return_entry_rw: return (%ld):%s, refcnt=%d\n",
id, rw ? "w" : "r", refcnt ));
#else
Debug( LDAP_DEBUG_TRACE,
- "====> bdb_cache_return_entry_%s( %ld ): created (%d)\n",
+ "====> bdb_unlocked_cache_return_entry_%s( %ld ): created (%d)\n",
rw ? "w" : "r", id, refcnt );
#endif
#ifdef NEW_LOGGING
LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
- "bdb_cache_return_entry_rw: %ld, delete pending (%d).\n",
+ "bdb_unlocked_cache_return_entry_rw: %ld, delete pending (%d).\n",
id, refcnt ));
#else
Debug( LDAP_DEBUG_TRACE,
- "====> bdb_cache_return_entry_%s( %ld ): delete pending (%d)\n",
+ "====> bdb_unlocked_cache_return_entry_%s( %ld ): delete pending (%d)\n",
rw ? "w" : "r", id, refcnt );
#endif
#ifdef NEW_LOGGING
LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
- "bdb_cache_return_entry_rw: (%ld): deleted (%d)\n",
+ "bdb_unlocked_cache_return_entry_rw: (%ld): deleted (%d)\n",
id, refcnt ));
#else
Debug( LDAP_DEBUG_TRACE,
- "====> bdb_cache_return_entry_%s( %ld ): deleted (%d)\n",
+ "====> bdb_unlocked_cache_return_entry_%s( %ld ): deleted (%d)\n",
rw ? "w" : "r", id, refcnt );
#endif
}
#ifdef NEW_LOGGING
LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
- "bdb_cache_return_entry_rw: ID %ld:%s returned (%d)\n",
+ "bdb_unlocked_cache_return_entry_rw: ID %ld:%s returned (%d)\n",
id, rw ? "w": "r", refcnt ));
#else
Debug( LDAP_DEBUG_TRACE,
- "====> bdb_cache_return_entry_%s( %ld ): returned (%d)\n",
+ "====> bdb_unlocked_cache_return_entry_%s( %ld ): returned (%d)\n",
rw ? "w" : "r", id, refcnt);
#endif
}
if( 0 ) {
retry: /* transaction retry */
if( e != NULL ) {
- bdb_cache_return_entry_w(bdb->bi_dbenv, &bdb->bi_cache, e, &lock);
+ bdb_unlocked_cache_return_entry_w(&bdb->bi_cache, e);
}
#ifdef NEW_LOGGING
LDAP_LOG (( "delete", LDAP_LEVEL_DETAIL1,
rc = access_allowed( be, conn, op, p,
children, NULL, ACL_WRITE, NULL );
- bdb_cache_return_entry_r(bdb->bi_dbenv, &bdb->bi_cache, p, &lock);
+ bdb_unlocked_cache_return_entry_r(&bdb->bi_cache, p);
p = NULL;
switch( opinfo.boi_err ) {
refs = is_entry_referral( matched )
? get_entry_referrals( be, conn, op, matched )
: NULL;
- bdb_cache_return_entry_r(bdb->bi_dbenv, &bdb->bi_cache, matched, &lock );
+ bdb_unlocked_cache_return_entry_r(&bdb->bi_cache, matched);
matched = NULL;
} else {
done:
/* free entry */
if( e != NULL ) {
- bdb_cache_return_entry_w(bdb->bi_dbenv, &bdb->bi_cache, e, &lock);
+ bdb_unlocked_cache_return_entry_w(&bdb->bi_cache, e);
}
if( ltid != NULL ) {
retry: /* transaction retry */
if( e != NULL ) {
bdb_cache_delete_entry(&bdb->bi_cache, e);
- bdb_cache_return_entry_w(bdb->bi_dbenv, &bdb->bi_cache, e, &lock);
+ bdb_unlocked_cache_return_entry_w(&bdb->bi_cache, e);
}
#ifdef NEW_LOGGING
LDAP_LOG (( "modify", LDAP_LEVEL_DETAIL1, "bdb_modify: retrying...\n" ));
refs = is_entry_referral( matched )
? get_entry_referrals( be, conn, op, matched )
: NULL;
- bdb_cache_return_entry_r (bdb->bi_dbenv, &bdb->bi_cache, matched, &lock);
+ bdb_unlocked_cache_return_entry_r (&bdb->bi_cache, matched);
matched = NULL;
} else {
}
if( e != NULL ) {
- bdb_cache_return_entry_w (bdb->bi_dbenv, &bdb->bi_cache, e, &lock);
+ bdb_unlocked_cache_return_entry_w (&bdb->bi_cache, e);
}
return rc;
}
retry: /* transaction retry */
if (e != NULL) {
bdb_cache_delete_entry(&bdb->bi_cache, e);
- bdb_cache_return_entry_w(bdb->bi_dbenv, &bdb->bi_cache, e, &lock);
+ bdb_unlocked_cache_return_entry_w(&bdb->bi_cache, e);
}
if (p != NULL) {
- bdb_cache_return_entry_r(bdb->bi_dbenv, &bdb->bi_cache, p, &lock);
+ bdb_unlocked_cache_return_entry_r(&bdb->bi_cache, p);
}
if (np != NULL) {
- bdb_cache_return_entry_r(bdb->bi_dbenv, &bdb->bi_cache, np, &lock);
+ bdb_unlocked_cache_return_entry_r(&bdb->bi_cache, np);
}
#ifdef NEW_LOGGING
LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: retrying...\n"));
refs = is_entry_referral( matched )
? get_entry_referrals( be, conn, op, matched )
: NULL;
- bdb_cache_return_entry_r( bdb->bi_dbenv, &bdb->bi_cache, matched, &lock );
+ bdb_unlocked_cache_return_entry_r( &bdb->bi_cache, matched);
matched = NULL;
} else {
/* LDAP v3 Support */
if( np != NULL ) {
/* free new parent and reader lock */
- bdb_cache_return_entry_r(bdb->bi_dbenv, &bdb->bi_cache, np, &lock);
+ bdb_unlocked_cache_return_entry_r(&bdb->bi_cache, np);
}
if( p != NULL ) {
/* free parent and reader lock */
- bdb_cache_return_entry_r(bdb->bi_dbenv, &bdb->bi_cache, p, &lock);
+ bdb_unlocked_cache_return_entry_r(&bdb->bi_cache, p);
}
/* free entry */
if( e != NULL ) {
- bdb_cache_return_entry_w( bdb->bi_dbenv, &bdb->bi_cache, e, &lock );
+ bdb_unlocked_cache_return_entry_w( &bdb->bi_cache, e);
}
if( ltid != NULL ) {
retry: /* transaction retry */
#if 0
if( e != NULL ) {
- bdb_cache_return_entry_w(bdb->bi_dbenv, &bdb->bi_cache, e, &lock);
+ bdb_unlocked_cache_return_entry_w(&bdb->bi_cache, e);
}
#endif
#ifdef NEW_LOGGING
#define bdb_cache_return_entry_r(env, c, e, l) bdb_cache_return_entry_rw((env), (c), (e), 0, (l))
#define bdb_cache_return_entry_w(env, c, e, l) bdb_cache_return_entry_rw((env), (c), (e), 1, (l))
void bdb_unlocked_cache_return_entry_rw( Cache *cache, Entry *e, int rw );
-#define bdb_unlocked_cache_return_entry_r( c, e ) bdb_cache_return_entry_rw((c), (e), 0)
-#define bdb_unlocked_cache_return_entry_w( c, e ) bdb_cache_return_entry_rw((c), (e), 1)
+#define bdb_unlocked_cache_return_entry_r( c, e ) bdb_unlocked_cache_return_entry_rw((c), (e), 0)
+#define bdb_unlocked_cache_return_entry_w( c, e ) bdb_unlocked_cache_return_entry_rw((c), (e), 1)
int bdb_cache_add_entry_rw(
DB_ENV *env,
Cache *cache,