]> git.sur5r.net Git - openldap/commitdiff
remove dbenv->lock_put() call from transaction-protected operations
authorJong Hyuk Choi <jongchoi@openldap.org>
Thu, 6 Jun 2002 10:14:14 +0000 (10:14 +0000)
committerJong Hyuk Choi <jongchoi@openldap.org>
Thu, 6 Jun 2002 10:14:14 +0000 (10:14 +0000)
servers/slapd/back-bdb/add.c
servers/slapd/back-bdb/cache.c
servers/slapd/back-bdb/delete.c
servers/slapd/back-bdb/modify.c
servers/slapd/back-bdb/modrdn.c
servers/slapd/back-bdb/operational.c
servers/slapd/back-bdb/proto-bdb.h

index 303ed63a35d19712a8efbb9477ddc374fbc16ec7..98fa9b85665a0c0e60fbc89325a5879ce13856ac 100644 (file)
@@ -173,7 +173,7 @@ retry:      /* transaction retry */
                                refs = is_entry_referral( matched )
                                        ? get_entry_referrals( be, conn, op, matched )
                                        : NULL;
-                               bdb_cache_return_entry_r(bdb->bi_dbenv, &bdb->bi_cache, matched, &lock);
+                               bdb_unlocked_cache_return_entry_r( &bdb->bi_cache, matched );
                                matched = NULL;
 
                        } else {
@@ -204,7 +204,7 @@ retry:      /* transaction retry */
                case DB_LOCK_DEADLOCK:
                case DB_LOCK_NOTGRANTED:
                        /* free parent and reader lock */
-                       bdb_cache_return_entry_r( bdb->bi_dbenv, &bdb->bi_cache, p, &lock );
+                       bdb_unlocked_cache_return_entry_r( &bdb->bi_cache, p );
                        p = NULL;
                        goto retry;
                }
@@ -266,7 +266,7 @@ retry:      /* transaction retry */
                                matched_dn, NULL, refs, NULL );
 
                        ber_bvarray_free( refs );
-                       bdb_cache_return_entry_r( bdb->bi_dbenv, &bdb->bi_cache, p, &lock );
+                       bdb_unlocked_cache_return_entry_r( &bdb->bi_cache, p );
                        p = NULL;
                        goto done;
                }
@@ -279,7 +279,7 @@ retry:      /* transaction retry */
 #endif
 
                /* free parent and reader lock */
-               bdb_cache_return_entry_r( bdb->bi_dbenv, &bdb->bi_cache, p, &lock );
+               bdb_unlocked_cache_return_entry_r( &bdb->bi_cache, p );
                p = NULL;
 
        } else {
index 35d5a5720dc1fba8f9a7a7cdae082c8b40ab0614..18854548fed61a6764105066e3f1d7348f53a697 100644 (file)
@@ -233,11 +233,11 @@ bdb_unlocked_cache_return_entry_rw( Cache *cache, Entry *e, int rw )
 
 #ifdef NEW_LOGGING
                LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
-                          "bdb_cache_return_entry_rw: return (%ld):%s, refcnt=%d\n",
+                          "bdb_unlocked_cache_return_entry_rw: return (%ld):%s, refcnt=%d\n",
                           id, rw ? "w" : "r", refcnt ));
 #else
                Debug( LDAP_DEBUG_TRACE,
-                       "====> bdb_cache_return_entry_%s( %ld ): created (%d)\n",
+                       "====> bdb_unlocked_cache_return_entry_%s( %ld ): created (%d)\n",
                        rw ? "w" : "r", id, refcnt );
 #endif
 
@@ -249,11 +249,11 @@ bdb_unlocked_cache_return_entry_rw( Cache *cache, Entry *e, int rw )
 
 #ifdef NEW_LOGGING
                        LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
-                                  "bdb_cache_return_entry_rw: %ld, delete pending (%d).\n",
+                                  "bdb_unlocked_cache_return_entry_rw: %ld, delete pending (%d).\n",
                                   id, refcnt ));
 #else
                        Debug( LDAP_DEBUG_TRACE,
-                               "====> bdb_cache_return_entry_%s( %ld ): delete pending (%d)\n",
+                               "====> bdb_unlocked_cache_return_entry_%s( %ld ): delete pending (%d)\n",
                                rw ? "w" : "r", id, refcnt );
 #endif
 
@@ -268,11 +268,11 @@ bdb_unlocked_cache_return_entry_rw( Cache *cache, Entry *e, int rw )
 
 #ifdef NEW_LOGGING
                        LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
-                                  "bdb_cache_return_entry_rw: (%ld): deleted (%d)\n",
+                                  "bdb_unlocked_cache_return_entry_rw: (%ld): deleted (%d)\n",
                                   id, refcnt ));
 #else
                        Debug( LDAP_DEBUG_TRACE,
-                               "====> bdb_cache_return_entry_%s( %ld ): deleted (%d)\n",
+                               "====> bdb_unlocked_cache_return_entry_%s( %ld ): deleted (%d)\n",
                                rw ? "w" : "r", id, refcnt );
 #endif
                }
@@ -283,11 +283,11 @@ bdb_unlocked_cache_return_entry_rw( Cache *cache, Entry *e, int rw )
 
 #ifdef NEW_LOGGING
                LDAP_LOG(( "cache", LDAP_LEVEL_DETAIL1,
-                          "bdb_cache_return_entry_rw: ID %ld:%s returned (%d)\n",
+                          "bdb_unlocked_cache_return_entry_rw: ID %ld:%s returned (%d)\n",
                           id, rw ? "w": "r", refcnt ));
 #else
                Debug( LDAP_DEBUG_TRACE,
-                       "====> bdb_cache_return_entry_%s( %ld ): returned (%d)\n",
+                       "====> bdb_unlocked_cache_return_entry_%s( %ld ): returned (%d)\n",
                        rw ? "w" : "r", id, refcnt);
 #endif
        }
index 9ded16580eef7d761ee4c4b26373397881599233..a348631cc73205f4f1564e750ddaf69f75e85d53 100644 (file)
@@ -52,7 +52,7 @@ bdb_delete(
        if( 0 ) {
 retry: /* transaction retry */
                if( e != NULL ) {
-                       bdb_cache_return_entry_w(bdb->bi_dbenv, &bdb->bi_cache, e, &lock);
+                       bdb_unlocked_cache_return_entry_w(&bdb->bi_cache, e);
                }
 #ifdef NEW_LOGGING
                LDAP_LOG (( "delete", LDAP_LEVEL_DETAIL1, 
@@ -152,7 +152,7 @@ retry:      /* transaction retry */
                rc = access_allowed( be, conn, op, p,
                        children, NULL, ACL_WRITE, NULL );
 
-               bdb_cache_return_entry_r(bdb->bi_dbenv, &bdb->bi_cache, p, &lock);
+               bdb_unlocked_cache_return_entry_r(&bdb->bi_cache, p);
                p = NULL;
 
                switch( opinfo.boi_err ) {
@@ -268,7 +268,7 @@ retry:      /* transaction retry */
                        refs = is_entry_referral( matched )
                                ? get_entry_referrals( be, conn, op, matched )
                                : NULL;
-                       bdb_cache_return_entry_r(bdb->bi_dbenv, &bdb->bi_cache, matched, &lock );
+                       bdb_unlocked_cache_return_entry_r(&bdb->bi_cache, matched);
                        matched = NULL;
 
                } else {
@@ -470,7 +470,7 @@ return_results:
 done:
        /* free entry */
        if( e != NULL ) {
-               bdb_cache_return_entry_w(bdb->bi_dbenv, &bdb->bi_cache, e, &lock);
+               bdb_unlocked_cache_return_entry_w(&bdb->bi_cache, e);
        }
 
        if( ltid != NULL ) {
index 2e47ab49a5f428c32ae12f07f5beb534b1f29f11..d205b60060b3b925e34da6ed69b678309afb62be 100644 (file)
@@ -262,7 +262,7 @@ bdb_modify(
 retry: /* transaction retry */
                if( e != NULL ) {
                        bdb_cache_delete_entry(&bdb->bi_cache, e);
-                       bdb_cache_return_entry_w(bdb->bi_dbenv, &bdb->bi_cache, e, &lock);
+                       bdb_unlocked_cache_return_entry_w(&bdb->bi_cache, e);
                }
 #ifdef NEW_LOGGING
                LDAP_LOG (( "modify", LDAP_LEVEL_DETAIL1, "bdb_modify: retrying...\n" ));
@@ -342,7 +342,7 @@ retry:      /* transaction retry */
                        refs = is_entry_referral( matched )
                                ? get_entry_referrals( be, conn, op, matched )
                                : NULL;
-                       bdb_cache_return_entry_r (bdb->bi_dbenv, &bdb->bi_cache, matched, &lock);
+                       bdb_unlocked_cache_return_entry_r (&bdb->bi_cache, matched);
                        matched = NULL;
 
                } else {
@@ -468,7 +468,7 @@ done:
        }
 
        if( e != NULL ) {
-               bdb_cache_return_entry_w (bdb->bi_dbenv, &bdb->bi_cache, e, &lock);
+               bdb_unlocked_cache_return_entry_w (&bdb->bi_cache, e);
        }
        return rc;
 }
index 0a7e1de7ee59c6d9b53c77ddcee5c25cfd2e21b4..30f345c7f072ed1193e2aaef51b0eb7c6f647a2c 100644 (file)
@@ -81,13 +81,13 @@ bdb_modrdn(
 retry: /* transaction retry */
                if (e != NULL) {
                        bdb_cache_delete_entry(&bdb->bi_cache, e);
-                       bdb_cache_return_entry_w(bdb->bi_dbenv, &bdb->bi_cache, e, &lock);
+                       bdb_unlocked_cache_return_entry_w(&bdb->bi_cache, e);
                }
                if (p != NULL) {
-                       bdb_cache_return_entry_r(bdb->bi_dbenv, &bdb->bi_cache, p, &lock);
+                       bdb_unlocked_cache_return_entry_r(&bdb->bi_cache, p);
                }
                if (np != NULL) {
-                       bdb_cache_return_entry_r(bdb->bi_dbenv, &bdb->bi_cache, np, &lock);
+                       bdb_unlocked_cache_return_entry_r(&bdb->bi_cache, np);
                }
 #ifdef NEW_LOGGING
                LDAP_LOG (( "modrdn", LDAP_LEVEL_DETAIL1, "==>bdb_modrdn: retrying...\n"));
@@ -157,7 +157,7 @@ retry:      /* transaction retry */
                        refs = is_entry_referral( matched )
                                ? get_entry_referrals( be, conn, op, matched )
                                : NULL;
-                       bdb_cache_return_entry_r( bdb->bi_dbenv, &bdb->bi_cache, matched, &lock );
+                       bdb_unlocked_cache_return_entry_r( &bdb->bi_cache, matched);
                        matched = NULL;
 
                } else {
@@ -860,17 +860,17 @@ done:
        /* LDAP v3 Support */
        if( np != NULL ) {
                /* free new parent and reader lock */
-               bdb_cache_return_entry_r(bdb->bi_dbenv, &bdb->bi_cache, np, &lock);
+               bdb_unlocked_cache_return_entry_r(&bdb->bi_cache, np);
        }
 
        if( p != NULL ) {
                /* free parent and reader lock */
-               bdb_cache_return_entry_r(bdb->bi_dbenv, &bdb->bi_cache, p, &lock);
+               bdb_unlocked_cache_return_entry_r(&bdb->bi_cache, p);
        }
 
        /* free entry */
        if( e != NULL ) {
-               bdb_cache_return_entry_w( bdb->bi_dbenv, &bdb->bi_cache, e, &lock );
+               bdb_unlocked_cache_return_entry_w( &bdb->bi_cache, e);
        }
 
        if( ltid != NULL ) {
index d0517abf9ecdf59e6c416abfdfe15b9923a4b5b7..5278c23ba3baa83ca6ed59a29f9a81223b903eab 100644 (file)
@@ -46,7 +46,7 @@ bdb_operational(
 retry: /* transaction retry */
 #if 0
                if( e != NULL ) {
-                       bdb_cache_return_entry_w(bdb->bi_dbenv, &bdb->bi_cache, e, &lock);
+                       bdb_unlocked_cache_return_entry_w(&bdb->bi_cache, e);
                }
 #endif
 #ifdef NEW_LOGGING
index 7cfe90293fdf37e7b73442db2753526f96aa7cab..f5c7af92fd366317f5c380ea9e4a9ece9c14d031 100644 (file)
@@ -307,8 +307,8 @@ void bdb_cache_return_entry_rw( DB_ENV *env, Cache *cache, Entry *e, int rw, DB_
 #define bdb_cache_return_entry_r(env, c, e, l) bdb_cache_return_entry_rw((env), (c), (e), 0, (l))
 #define bdb_cache_return_entry_w(env, c, e, l) bdb_cache_return_entry_rw((env), (c), (e), 1, (l))
 void bdb_unlocked_cache_return_entry_rw( Cache *cache, Entry *e, int rw );
-#define bdb_unlocked_cache_return_entry_r( c, e ) bdb_cache_return_entry_rw((c), (e), 0)
-#define bdb_unlocked_cache_return_entry_w( c, e ) bdb_cache_return_entry_rw((c), (e), 1)
+#define bdb_unlocked_cache_return_entry_r( c, e ) bdb_unlocked_cache_return_entry_rw((c), (e), 0)
+#define bdb_unlocked_cache_return_entry_w( c, e ) bdb_unlocked_cache_return_entry_rw((c), (e), 1)
 int bdb_cache_add_entry_rw(
        DB_ENV  *env,
        Cache   *cache,