From c5ee5212fdd3025d2c5820ddfaa181e6aa868992 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Wed, 21 Sep 2011 15:59:08 -0700 Subject: [PATCH] Updated for mdb_txn_begin API change. Nested txn stuff which we don't use. --- servers/slapd/back-mdb/attr.c | 2 +- servers/slapd/back-mdb/config.c | 2 +- servers/slapd/back-mdb/id2entry.c | 6 +++--- servers/slapd/back-mdb/init.c | 2 +- servers/slapd/back-mdb/tools.c | 10 +++++----- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/servers/slapd/back-mdb/attr.c b/servers/slapd/back-mdb/attr.c index 14e67d884e..f4f8c56b61 100644 --- a/servers/slapd/back-mdb/attr.c +++ b/servers/slapd/back-mdb/attr.c @@ -99,7 +99,7 @@ mdb_attr_dbs_open( txn = tx0; if ( txn == NULL ) { - rc = mdb_txn_begin( mdb->mi_dbenv, 0, &txn ); + rc = mdb_txn_begin( mdb->mi_dbenv, NULL, 0, &txn ); if ( rc ) { snprintf( cr->msg, sizeof(cr->msg), "database \"%s\": " "txn_begin failed: %s (%d).", diff --git a/servers/slapd/back-mdb/config.c b/servers/slapd/back-mdb/config.c index 8e9df9a039..831aec0051 100644 --- a/servers/slapd/back-mdb/config.c +++ b/servers/slapd/back-mdb/config.c @@ -141,7 +141,7 @@ mdb_online_index( void *ctx, void *arg ) if ( slapd_shutdown ) break; - rc = mdb_txn_begin( mdb->mi_dbenv, 0, &txn ); + rc = mdb_txn_begin( mdb->mi_dbenv, NULL, 0, &txn ); if ( rc ) break; rc = mdb_cursor_open( txn, mdb->mi_id2entry, &curs ); diff --git a/servers/slapd/back-mdb/id2entry.c b/servers/slapd/back-mdb/id2entry.c index 2d0e00e4a0..3ae947bdd5 100644 --- a/servers/slapd/back-mdb/id2entry.c +++ b/servers/slapd/back-mdb/id2entry.c @@ -408,7 +408,7 @@ mdb_opinfo_get( Operation *op, struct mdb_info *mdb, int rdonly, mdb_op_info **m } moi->moi_ref++; if ( !moi->moi_txn ) { - rc = mdb_txn_begin( mdb->mi_dbenv, 0, &moi->moi_txn ); + rc = mdb_txn_begin( mdb->mi_dbenv, NULL, 0, &moi->moi_txn ); if (rc) { Debug( LDAP_DEBUG_ANY, "mdb_opinfo_get: err %s(%d)\n", mdb_strerror(rc), rc, 0 ); @@ -422,7 +422,7 @@ mdb_opinfo_get( Operation *op, struct mdb_info *mdb, int rdonly, mdb_op_info **m if ( !moi->moi_txn ) { if ( !ctx ) { /* Shouldn't happen unless we're single-threaded */ - rc = mdb_txn_begin( mdb->mi_dbenv, MDB_RDONLY, &moi->moi_txn ); + rc = mdb_txn_begin( mdb->mi_dbenv, NULL, MDB_RDONLY, &moi->moi_txn ); if (rc) { Debug( LDAP_DEBUG_ANY, "mdb_opinfo_get: err %s(%d)\n", mdb_strerror(rc), rc, 0 ); @@ -430,7 +430,7 @@ mdb_opinfo_get( Operation *op, struct mdb_info *mdb, int rdonly, mdb_op_info **m return rc; } if ( ldap_pvt_thread_pool_getkey( ctx, mdb->mi_dbenv, &data, NULL ) ) { - rc = mdb_txn_begin( mdb->mi_dbenv, MDB_RDONLY, &moi->moi_txn ); + rc = mdb_txn_begin( mdb->mi_dbenv, NULL, MDB_RDONLY, &moi->moi_txn ); if (rc) { Debug( LDAP_DEBUG_ANY, "mdb_opinfo_get: err %s(%d)\n", mdb_strerror(rc), rc, 0 ); diff --git a/servers/slapd/back-mdb/init.c b/servers/slapd/back-mdb/init.c index d2880c5755..8b08fc0cad 100644 --- a/servers/slapd/back-mdb/init.c +++ b/servers/slapd/back-mdb/init.c @@ -182,7 +182,7 @@ mdb_db_open( BackendDB *be, ConfigReply *cr ) goto fail; } - rc = mdb_txn_begin( mdb->mi_dbenv, 0, &txn ); + rc = mdb_txn_begin( mdb->mi_dbenv, NULL, 0, &txn ); if ( rc ) { Debug( LDAP_DEBUG_ANY, LDAP_XSTRING(mdb_db_open) ": database \"%s\" cannot be opened, err %d. " diff --git a/servers/slapd/back-mdb/tools.c b/servers/slapd/back-mdb/tools.c index c1ccfd518e..08dc01d9af 100644 --- a/servers/slapd/back-mdb/tools.c +++ b/servers/slapd/back-mdb/tools.c @@ -186,7 +186,7 @@ ID mdb_tool_entry_next( assert( mdb != NULL ); if ( !txn ) { - rc = mdb_txn_begin( mdb->mi_dbenv, MDB_RDONLY, &txn ); + rc = mdb_txn_begin( mdb->mi_dbenv, NULL, MDB_RDONLY, &txn ); if ( rc ) return NOID; rc = mdb_cursor_open( txn, mdb->mi_id2entry, &cursor ); @@ -255,7 +255,7 @@ ID mdb_tool_dn2id_get( mdb = (struct mdb_info *) be->be_private; if ( !txn ) { - rc = mdb_txn_begin( mdb->mi_dbenv, (slapMode & SLAP_TOOL_READONLY) != 0 ? + rc = mdb_txn_begin( mdb->mi_dbenv, NULL, (slapMode & SLAP_TOOL_READONLY) != 0 ? MDB_RDONLY : 0, &txn ); if ( rc ) return NOID; @@ -545,7 +545,7 @@ ID mdb_tool_entry_put( mdb = (struct mdb_info *) be->be_private; if ( !txn ) { - rc = mdb_txn_begin( mdb->mi_dbenv, 0, &txn ); + rc = mdb_txn_begin( mdb->mi_dbenv, NULL, 0, &txn ); if( rc != 0 ) { snprintf( text->bv_val, text->bv_len, "txn_begin failed: %s (%d)", @@ -716,7 +716,7 @@ int mdb_tool_entry_reindex( } if ( !txi ) { - rc = mdb_txn_begin( mi->mi_dbenv, 0, &txi ); + rc = mdb_txn_begin( mi->mi_dbenv, NULL, 0, &txi ); if( rc != 0 ) { Debug( LDAP_DEBUG_ANY, "=> " LDAP_XSTRING(mdb_tool_entry_reindex) ": " @@ -803,7 +803,7 @@ ID mdb_tool_entry_modify( mdb_cursor_close( cursor ); cursor = NULL; } - rc = mdb_txn_begin( mdb->mi_dbenv, 0, &tid ); + rc = mdb_txn_begin( mdb->mi_dbenv, NULL, 0, &tid ); if( rc != 0 ) { snprintf( text->bv_val, text->bv_len, "txn_begin failed: %s (%d)", -- 2.39.5