]> git.sur5r.net Git - openldap/commitdiff
Just use a readlock in cache loader
authorHoward Chu <hyc@openldap.org>
Thu, 8 Feb 2007 09:27:35 +0000 (09:27 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 8 Feb 2007 09:27:35 +0000 (09:27 +0000)
servers/slapd/back-bdb/cache.c

index 7f93b3bad1096373bf04c069f3da0cf9fd66a3a5..06c4ba16ea35051c01b54c7a9059279c66220783 100644 (file)
@@ -837,7 +837,7 @@ load1:
                                bdb_cache_entryinfo_unlock( *eip );
                                islocked = 0;
                        }
-                       rc = bdb_cache_entry_db_lock( bdb, locker, *eip, load, 0, lock );
+                       rc = bdb_cache_entry_db_lock( bdb, locker, *eip, 0, 0, lock );
                        if ( (*eip)->bei_state & CACHE_ENTRY_DELETED ) {
                                rc = DB_NOTFOUND;
                                bdb_cache_entry_db_unlock( bdb, lock );
@@ -858,12 +858,8 @@ load1:
                                                ep = NULL;
                                                bdb_cache_lru_link( bdb, *eip );
                                        }
-                                       if ( rc == 0 ) {
-                                               /* If we succeeded, downgrade back to a readlock. */
-                                               rc = bdb_cache_entry_db_relock( bdb, locker,
-                                                       *eip, 0, 0, lock );
-                                       } else {
-                                               /* Otherwise, release the lock. */
+                                       if ( rc ) {
+                                               /* On error, release the lock. */
                                                bdb_cache_entry_db_unlock( bdb, lock );
                                        }
                                } else if ( !(*eip)->bei_e ) {