]> git.sur5r.net Git - openldap/commitdiff
ITS#5262 additional cleanup
authorHoward Chu <hyc@openldap.org>
Wed, 5 Dec 2007 14:56:47 +0000 (14:56 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 5 Dec 2007 14:56:47 +0000 (14:56 +0000)
servers/slapd/back-bdb/cache.c
servers/slapd/back-bdb/dn2id.c
servers/slapd/back-bdb/proto-bdb.h
servers/slapd/back-bdb/tools.c

index 6215142435b4bf9430abf7b5a3169ba2089986df..bf0c02b0a400aa4f95f79c049df2f898b830e508 100644 (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
        }
index 7dbe325c044e7971f6138eed7c00c00b9a6d9b7e..0f6b1927bbfeadabdb3aa5e95167c00274be248c 100644 (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);
        }
 
index 27de00c59b07d081fb693cfcaab313472c334ce6..d0f01989ad79be20c36ff43ad84037942b9ee7d4 100644 (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
index ff9d3199b0f5e4390a9b7607444bb7442cc6f122..05e6fc3fbaeb231b4b7b3fd426376b52957aa14b 100644 (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;