From: Howard Chu Date: Wed, 5 Dec 2007 14:56:47 +0000 (+0000) Subject: ITS#5262 additional cleanup X-Git-Tag: OPENLDAP_REL_ENG_2_4_9~20^2~354 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=460e94c001dce007cad7b61b81dd1a17f1bf67c7;p=openldap ITS#5262 additional cleanup --- diff --git a/servers/slapd/back-bdb/cache.c b/servers/slapd/back-bdb/cache.c index 6215142435..bf0c02b0a4 100644 --- a/servers/slapd/back-bdb/cache.c +++ b/servers/slapd/back-bdb/cache.c @@ -351,6 +351,8 @@ bdb_entryinfo_add_internal( ei->bei_rdn.bv_val = NULL; #endif } else { + int rc; + bdb->bi_cache.c_eiused++; ber_dupbv( &ei2->bei_nrdn, &ei->bei_nrdn ); @@ -360,8 +362,9 @@ bdb_entryinfo_add_internal( */ 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 @@ -484,7 +487,6 @@ bdb_cache_find_ndn( int hdb_cache_find_parent( Operation *op, - DB_TXN *txn, BDB_LOCKER locker, ID id, EntryInfo **res ) @@ -498,7 +500,7 @@ hdb_cache_find_parent( 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 */ @@ -835,7 +837,7 @@ again: ldap_pvt_thread_rdwr_rlock( &bdb->bi_cache.c_rwlock ); } } #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 } diff --git a/servers/slapd/back-bdb/dn2id.c b/servers/slapd/back-bdb/dn2id.c index 7dbe325c04..0f6b1927bb 100644 --- a/servers/slapd/back-bdb/dn2id.c +++ b/servers/slapd/back-bdb/dn2id.c @@ -722,7 +722,6 @@ hdb_dn2id( int hdb_dn2id_parent( Operation *op, - DB_TXN *txn, BDB_LOCKER locker, EntryInfo *ei, ID *idp ) @@ -746,9 +745,9 @@ hdb_dn2id_parent( 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); } diff --git a/servers/slapd/back-bdb/proto-bdb.h b/servers/slapd/back-bdb/proto-bdb.h index 27de00c59b..d0f01989ad 100644 --- a/servers/slapd/back-bdb/proto-bdb.h +++ b/servers/slapd/back-bdb/proto-bdb.h @@ -132,7 +132,6 @@ int bdb_dn2idl( int bdb_dn2id_parent( Operation *op, - DB_TXN *txn, BDB_LOCKER locker, EntryInfo *ei, ID *idp ); @@ -552,7 +551,6 @@ int bdb_cache_find_id( int bdb_cache_find_parent( Operation *op, - DB_TXN *txn, BDB_LOCKER locker, ID id, EntryInfo **res diff --git a/servers/slapd/back-bdb/tools.c b/servers/slapd/back-bdb/tools.c index ff9d3199b0..05e6fc3fba 100644 --- a/servers/slapd/back-bdb/tools.c +++ b/servers/slapd/back-bdb/tools.c @@ -306,7 +306,7 @@ Entry* bdb_tool_entry_get( BackendDB *be, ID id ) 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;