From: Howard Chu Date: Thu, 1 May 2008 13:25:15 +0000 (+0000) Subject: Fix prev commit X-Git-Tag: LOCKER_IDS~186 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=aeedb72e91565a8a58dd76f5c74cb8726a2a6c26;p=openldap Fix prev commit --- diff --git a/servers/slapd/back-bdb/add.c b/servers/slapd/back-bdb/add.c index 3405756970..36acb47696 100644 --- a/servers/slapd/back-bdb/add.c +++ b/servers/slapd/back-bdb/add.c @@ -159,7 +159,7 @@ retry: /* transaction retry */ locker = TXN_ID ( ltid ); - opinfo.boi_oe.oe_key = op->o_bd->bd_self; + opinfo.boi_oe.oe_key = bdb; opinfo.boi_txn = ltid; opinfo.boi_err = 0; opinfo.boi_acl_cache = op->o_do_not_cache; diff --git a/servers/slapd/back-bdb/cache.c b/servers/slapd/back-bdb/cache.c index edf73ab28c..8351252587 100644 --- a/servers/slapd/back-bdb/cache.c +++ b/servers/slapd/back-bdb/cache.c @@ -174,6 +174,8 @@ bdb_cache_entry_db_relock( if ( !lock ) return 0; +Debug( LDAP_DEBUG_TRACE, "bdb_cache_entry_dn_relock: lock %p locker %d\n", lock,locker,0 ); + lockobj.data = &ei->bei_id; lockobj.size = sizeof(ei->bei_id) + 1; @@ -210,6 +212,8 @@ bdb_cache_entry_db_lock( struct bdb_info *bdb, BDB_LOCKER locker, EntryInfo *ei, if ( !lock ) return 0; +Debug( LDAP_DEBUG_TRACE, "bdb_cache_entry_db_lock: lock %p locker %d\n", lock,locker,0 ); + if (rw) db_rw = DB_LOCK_WRITE; else @@ -239,6 +243,8 @@ bdb_cache_entry_db_unlock ( struct bdb_info *bdb, DB_LOCK *lock ) if ( !lock || lock->mode == DB_LOCK_NG ) return 0; +Debug( LDAP_DEBUG_TRACE, "bdb_cache_entry_db_unlock: lock %p\n", lock,0,0 ); + rc = LOCK_PUT ( bdb->bi_dbenv, lock ); return rc; #endif diff --git a/servers/slapd/back-bdb/delete.c b/servers/slapd/back-bdb/delete.c index 00b3a9409a..6f0207f6e6 100644 --- a/servers/slapd/back-bdb/delete.c +++ b/servers/slapd/back-bdb/delete.c @@ -156,7 +156,7 @@ retry: /* transaction retry */ locker = TXN_ID ( ltid ); - opinfo.boi_oe.oe_key = op->o_bd->bd_self; + opinfo.boi_oe.oe_key = bdb; opinfo.boi_txn = ltid; opinfo.boi_err = 0; opinfo.boi_acl_cache = op->o_do_not_cache; diff --git a/servers/slapd/back-bdb/id2entry.c b/servers/slapd/back-bdb/id2entry.c index 5059e06270..15da6c7659 100644 --- a/servers/slapd/back-bdb/id2entry.c +++ b/servers/slapd/back-bdb/id2entry.c @@ -259,7 +259,7 @@ int bdb_entry_release( } /* free entry and reader or writer lock */ LDAP_SLIST_FOREACH( oex, &op->o_extra, oe_next ) { - if ( oex->oe_key == op->o_bd->bd_self ) break; + if ( oex->oe_key == bdb ) break; } boi = (struct bdb_op_info *)oex; @@ -335,7 +335,7 @@ int bdb_entry_get( if( op ) { OpExtra *oex; LDAP_SLIST_FOREACH( oex, &op->o_extra, oe_next ) { - if ( oex->oe_key == op->o_bd->bd_self ) break; + if ( oex->oe_key == bdb ) break; } boi = (struct bdb_op_info *)oex; if ( boi ) @@ -416,7 +416,7 @@ return_results: if ( op ) { if ( !boi ) { boi = op->o_tmpcalloc(1,sizeof(struct bdb_op_info),op->o_tmpmemctx); - boi->boi_oe.oe_key = op->o_bd; + boi->boi_oe.oe_key = bdb; LDAP_SLIST_INSERT_HEAD( &op->o_extra, &boi->boi_oe, oe_next ); } if ( !boi->boi_txn ) { diff --git a/servers/slapd/back-bdb/modify.c b/servers/slapd/back-bdb/modify.c index 9fdb85d4de..67d04d95f3 100644 --- a/servers/slapd/back-bdb/modify.c +++ b/servers/slapd/back-bdb/modify.c @@ -440,7 +440,7 @@ retry: /* transaction retry */ locker = TXN_ID ( ltid ); - opinfo.boi_oe.oe_key = op->o_bd->bd_self; + opinfo.boi_oe.oe_key = bdb; opinfo.boi_txn = ltid; opinfo.boi_err = 0; opinfo.boi_acl_cache = op->o_do_not_cache; diff --git a/servers/slapd/back-bdb/modrdn.c b/servers/slapd/back-bdb/modrdn.c index 6b31e416b5..fbe9f2ea20 100644 --- a/servers/slapd/back-bdb/modrdn.c +++ b/servers/slapd/back-bdb/modrdn.c @@ -166,7 +166,7 @@ retry: /* transaction retry */ locker = TXN_ID ( ltid ); - opinfo.boi_oe.oe_key = op->o_bd->bd_self; + opinfo.boi_oe.oe_key = bdb; opinfo.boi_txn = ltid; opinfo.boi_err = 0; opinfo.boi_acl_cache = op->o_do_not_cache; diff --git a/servers/slapd/back-bdb/search.c b/servers/slapd/back-bdb/search.c index fe4890b77b..448316516f 100644 --- a/servers/slapd/back-bdb/search.c +++ b/servers/slapd/back-bdb/search.c @@ -328,7 +328,7 @@ bdb_search( Operation *op, SlapReply *rs ) attrs = op->oq_search.rs_attrs; LDAP_SLIST_FOREACH( oex, &op->o_extra, oe_next ) { - if ( oex->oe_key == (void *)op->o_bd->bd_self ) + if ( oex->oe_key == bdb ) break; } opinfo = (struct bdb_op_info *) oex;