ITS#5262 additional cleanup

This commit is contained in:
Howard Chu 2007-12-05 14:56:47 +00:00
parent 6ac8a0c584
commit 460e94c001
4 changed files with 9 additions and 10 deletions

View file

@ -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
}

View file

@ -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);
}

View file

@ -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

View file

@ -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;