]> git.sur5r.net Git - openldap/commitdiff
ITS#4088 force cursors to use same locker
authorHoward Chu <hyc@openldap.org>
Tue, 18 Oct 2005 20:52:04 +0000 (20:52 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 18 Oct 2005 20:52:04 +0000 (20:52 +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 598549e8cd48c1108eb38ca8eea791f00667e30b..eb894b2757826c30f62aca6b2800e53dbf7e4b38 100644 (file)
@@ -388,6 +388,7 @@ int
 hdb_cache_find_parent(
        Operation *op,
        DB_TXN *txn,
+       u_int32_t       locker,
        ID id,
        EntryInfo **res )
 {
@@ -401,7 +402,7 @@ hdb_cache_find_parent(
        ei.bei_ckids = 0;
 
        for (;;) {
-               rc = hdb_dn2id_parent( op, txn, &ei, &eip.bei_id );
+               rc = hdb_dn2id_parent( op, txn, locker, &ei, &eip.bei_id );
                if ( rc ) break;
 
                /* Save the previous node, if any */
@@ -718,7 +719,7 @@ again:      ldap_pvt_thread_rdwr_rlock( &bdb->bi_cache.c_rwlock );
                        }
                }
 #else
-               rc = hdb_cache_find_parent(op, tid, id, eip );
+               rc = hdb_cache_find_parent(op, tid, locker, id, eip );
                if ( rc == 0 && *eip ) islocked = 1;
 #endif
        }
index d2ed137e979716e881c372e6c82f475a0cfe9307..f23ec7f915ae669e185ed4dc64e2ec203e16ba65 100644 (file)
@@ -709,6 +709,7 @@ int
 hdb_dn2id_parent(
        Operation *op,
        DB_TXN *txn,
+       u_int32_t       locker,
        EntryInfo *ei,
        ID *idp )
 {
@@ -733,6 +734,9 @@ hdb_dn2id_parent(
 
        rc = db->cursor( db, txn, &cursor, bdb->bi_db_opflags );
        if ( rc ) return rc;
+       if ( !txn && locker ) {
+               cursor->locker = locker;
+       }
 
        data.ulen = sizeof(diskNode) + (SLAP_LDAPDN_MAXLEN * 2);
        d = op->o_tmpalloc( data.ulen, op->o_tmpmemctx );
index 232289f7c924c26153a546b3e1f31da081757477..a71728f6c09c62ff4ea86b36cb3727b5d300ba3f 100644 (file)
@@ -124,6 +124,7 @@ int bdb_dn2idl(
 int bdb_dn2id_parent(
        Operation *op,
        DB_TXN *txn,
+       u_int32_t locker,
        EntryInfo *ei,
        ID *idp );
 
@@ -500,6 +501,7 @@ int
 bdb_cache_find_parent(
        Operation *op,
        DB_TXN *txn,
+       u_int32_t       locker,
        ID id,
        EntryInfo **res
 );
index 6064d938421ab1eb04b8c5dfa0eb1bbc6a115de3..c4920f4f3b8b4b7bc0b82ca71dcc5c9113462e54 100644 (file)
@@ -214,7 +214,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, id, &ei );
+               rc = bdb_cache_find_parent( &op, NULL, cursor->locker, id, &ei );
                if ( rc == LDAP_SUCCESS ) {
                        bdb_cache_entryinfo_unlock( ei );
                        e->e_private = ei;