]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-bdb/proto-bdb.h
Cleanup prev commit
[openldap] / servers / slapd / back-bdb / proto-bdb.h
index 19cdb7ddf4469ad816cf0ba2f4b0be9b4d0d85d4..34862d31909dda6d7a9c471290f18a590dfe5e6c 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2000-2006 The OpenLDAP Foundation.
+ * Copyright 2000-2007 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -120,6 +120,7 @@ int bdb_dn2id_children(
 
 int bdb_dn2idl(
        Operation *op,
+       u_int32_t locker,
        Entry *e,
        ID *ids,
        ID *stack );
@@ -166,6 +167,7 @@ char *ebcdic_dberror( int rc );
 
 int bdb_filter_candidates(
        Operation *op,
+       u_int32_t locker,
        Filter  *f,
        ID *ids,
        ID *tmp,
@@ -282,7 +284,7 @@ unsigned bdb_idl_search( ID *ids, ID id );
 int bdb_idl_fetch_key(
        BackendDB       *be,
        DB                      *db,
-       DB_TXN          *tid,
+       u_int32_t locker,
        DBT                     *key,
        ID                      *ids,
        DBC                     **saved_cursor,
@@ -388,7 +390,7 @@ extern int
 bdb_key_read(
     Backend    *be,
        DB *db,
-       DB_TXN *txn,
+       u_int32_t locker,
     struct berval *k,
        ID *ids,
     DBC **saved_cursor,
@@ -426,6 +428,19 @@ int bdb_modify_internal(
        char *textbuf,
        size_t textlen );
 
+/*
+ * monitor.c
+ */
+
+#define bdb_monitor_db_init    BDB_SYMBOL(monitor_db_init)
+#define bdb_monitor_db_open    BDB_SYMBOL(monitor_db_open)
+#define bdb_monitor_db_close   BDB_SYMBOL(monitor_db_close)
+#define bdb_monitor_db_destroy BDB_SYMBOL(monitor_db_destroy)
+
+int bdb_monitor_db_init( BackendDB *be );
+int bdb_monitor_db_open( BackendDB *be );
+int bdb_monitor_db_close( BackendDB *be );
+int bdb_monitor_db_destroy( BackendDB *be );
 
 /*
  * cache.c
@@ -436,25 +451,27 @@ int bdb_modify_internal(
        ldap_pvt_thread_mutex_lock( &(e)->bei_kids_mutex )
 #define        bdb_cache_entryinfo_unlock(e) \
        ldap_pvt_thread_mutex_unlock( &(e)->bei_kids_mutex )
+#define        bdb_cache_entryinfo_trylock(e) \
+       ldap_pvt_thread_mutex_trylock( &(e)->bei_kids_mutex )
 
 /* What a mess. Hopefully the current cache scheme will stabilize
  * and we can trim out all of this stuff.
  */
 #if 0
-void bdb_cache_return_entry_rw( DB_ENV *env, Cache *cache, Entry *e,
+void bdb_cache_return_entry_rw( struct bdb_info *bdb, Entry *e,
        int rw, DB_LOCK *lock );
 #else
-#define bdb_cache_return_entry_rw( env, cache, e, rw, lock ) \
-       bdb_cache_entry_db_unlock( env, lock )
-#define        bdb_cache_return_entry( env, lock ) \
-       bdb_cache_entry_db_unlock( env, lock )
+#define bdb_cache_return_entry_rw( bdb, e, rw, lock ) \
+       bdb_cache_entry_db_unlock( bdb, lock )
+#define        bdb_cache_return_entry( bdb, lock ) \
+       bdb_cache_entry_db_unlock( bdb, lock )
 #endif
-#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))
+#define bdb_cache_return_entry_r(bdb, e, l) \
+       bdb_cache_return_entry_rw((bdb), (e), 0, (l))
+#define bdb_cache_return_entry_w(bdb, e, l) \
+       bdb_cache_return_entry_rw((bdb), (e), 1, (l))
 #if 0
-void bdb_unlocked_cache_return_entry_rw( Cache *cache, Entry *e, int rw );
+void bdb_unlocked_cache_return_entry_rw( struct bdb_info *bdb, Entry *e, int rw );
 #else
 #define        bdb_unlocked_cache_return_entry_rw( a, b, c )   ((void)0)
 #endif
@@ -486,7 +503,8 @@ int bdb_cache_add(
        EntryInfo *pei,
        Entry   *e,
        struct berval *nrdn,
-       u_int32_t locker
+       u_int32_t locker,
+       DB_LOCK *lock
 );
 int bdb_cache_modrdn(
        struct bdb_info *bdb,
@@ -498,9 +516,9 @@ int bdb_cache_modrdn(
        DB_LOCK *lock
 );
 int bdb_cache_modify(
+       struct bdb_info *bdb,
        Entry *e,
        Attribute *newAttrs,
-       DB_ENV *env,
        u_int32_t locker,
        DB_LOCK *lock
 );
@@ -532,9 +550,8 @@ bdb_cache_find_parent(
        EntryInfo **res
 );
 int bdb_cache_delete(
-       Cache   *cache,
+       struct bdb_info *bdb,
        Entry   *e,
-       DB_ENV  *env,
        u_int32_t locker,
        DB_LOCK *lock
 );
@@ -543,12 +560,6 @@ void bdb_cache_delete_cleanup(
        EntryInfo *ei
 );
 void bdb_cache_release_all( Cache *cache );
-void bdb_cache_delete_entry(
-       struct bdb_info *bdb,
-       EntryInfo *ei,
-       u_int32_t locker,
-       DB_LOCK *lock
-);
 
 #ifdef BDB_HIER
 int hdb_cache_load(
@@ -560,7 +571,7 @@ int hdb_cache_load(
 
 #define bdb_cache_entry_db_relock              BDB_SYMBOL(cache_entry_db_relock)
 int bdb_cache_entry_db_relock(
-       DB_ENV *env,
+       struct bdb_info *bdb,
        u_int32_t locker,
        EntryInfo *ei,
        int rw,
@@ -568,7 +579,7 @@ int bdb_cache_entry_db_relock(
        DB_LOCK *lock );
 
 int bdb_cache_entry_db_unlock(
-       DB_ENV *env,
+       struct bdb_info *bdb,
        DB_LOCK *lock );
 
 #ifdef BDB_REUSE_LOCKERS