]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-bdb/config.c
zap charray
[openldap] / servers / slapd / back-bdb / config.c
index da6a7db39f3d3b35c6ffa24572854d4c868b788f..bd74e95e8c32f39f3bb19f0b8faa22ab72cba048 100644 (file)
@@ -1,7 +1,7 @@
 /* config.c - bdb backend configuration file routine */
 /* $OpenLDAP$ */
 /*
- * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 
@@ -12,7 +12,9 @@
 
 #include "back-bdb.h"
 
-#define        SLAP_BDB_ALLOW_DBNOTXN
+#ifdef DB_DIRTY_READ
+#      define  SLAP_BDB_ALLOW_DIRTY_READ
+#endif
 
 int
 bdb_db_config(
@@ -44,10 +46,9 @@ bdb_db_config(
                }
                bdb->bi_dbenv_home = ch_strdup( argv[1] );
 
-#ifdef SLAP_BDB_ALLOW_DBNOTXN
-       /* turn off transactions, use CDB mode instead */
-       } else if ( strcasecmp( argv[0], "dbnotxn" ) == 0 ) {
-               bdb->bi_txn = 0;
+#ifdef SLAP_BDB_ALLOW_DIRTY_READ
+       } else if ( strcasecmp( argv[0], "dirtyread" ) == 0 ) {
+               bdb->bi_db_opflags |= DB_DIRTY_READ;
 #endif
        /* transaction checkpoint configuration */
        } else if ( strcasecmp( argv[0], "dbnosync" ) == 0 ) {
@@ -87,6 +88,9 @@ bdb_db_config(
                } else if( strcasecmp( argv[1], "youngest" ) == 0 ) {
                        bdb->bi_lock_detect = DB_LOCK_YOUNGEST;
 
+               } else if( strcasecmp( argv[1], "fewest" ) == 0 ) {
+                       bdb->bi_lock_detect = DB_LOCK_MINLOCKS;
+
                } else {
                        fprintf( stderr, "%s: line %d: "
                                "bad policy (%s) in \"lockDetect <policy> <seconds>\" line\n",
@@ -117,7 +121,6 @@ bdb_db_config(
                }
                bdb->bi_dbenv_mode = strtol( argv[1], NULL, 0 );
 
-#if BDB_FILTER_INDICES
        /* attribute to index */
        } else if ( strcasecmp( argv[0], "index" ) == 0 ) {
                int rc;
@@ -135,7 +138,16 @@ bdb_db_config(
                rc = bdb_attr_index_config( bdb, fname, lineno, argc - 1, &argv[1] );
 
                if( rc != LDAP_SUCCESS ) return 1;
-#endif
+
+       /* size of the cache in entries */
+         } else if ( strcasecmp( argv[0], "cachesize" ) == 0 ) {
+                 if ( argc < 2 ) {
+                         fprintf( stderr,
+                 "%s: line %d: missing size in \"cachesize <size>\" line\n",
+                             fname, lineno );
+                         return( 1 );
+                 }
+                 bdb->bi_cache.c_maxsize = atoi( argv[1] );
 
        /* anything else */
        } else {