summaryrefslogtreecommitdiff
path: root/db/txn/txn_method.c
diff options
context:
space:
mode:
Diffstat (limited to 'db/txn/txn_method.c')
-rw-r--r--db/txn/txn_method.c87
1 files changed, 30 insertions, 57 deletions
diff --git a/db/txn/txn_method.c b/db/txn/txn_method.c
index c13f86dee..f56867473 100644
--- a/db/txn/txn_method.c
+++ b/db/txn/txn_method.c
@@ -1,46 +1,24 @@
/*-
* See the file LICENSE for redistribution information.
*
- * Copyright (c) 1996-2004
- * Sleepycat Software. All rights reserved.
+ * Copyright (c) 1996-2006
+ * Oracle Corporation. All rights reserved.
*
- * $Id: txn_method.c,v 11.72 2004/03/23 17:24:18 bostic Exp $
+ * $Id: txn_method.c,v 12.6 2006/08/24 14:46:53 bostic Exp $
*/
#include "db_config.h"
-#ifndef NO_SYSTEM_INCLUDES
-#include <sys/types.h>
-
-#ifdef HAVE_RPC
-#include <rpc/rpc.h>
-#endif
-
-#include <string.h>
-#endif
-
-#ifdef HAVE_RPC
-#include "db_server.h"
-#endif
-
#include "db_int.h"
#include "dbinc/txn.h"
-#ifdef HAVE_RPC
-#include "dbinc_auto/rpc_client_ext.h"
-#endif
-
-static int __txn_get_tx_max __P((DB_ENV *, u_int32_t *));
-static int __txn_get_tx_timestamp __P((DB_ENV *, time_t *));
-static int __txn_set_tx_timestamp __P((DB_ENV *, time_t *));
-
/*
* __txn_dbenv_create --
* Transaction specific initialization of the DB_ENV structure.
*
- * PUBLIC: void __txn_dbenv_create __P((DB_ENV *));
+ * PUBLIC: int __txn_dbenv_create __P((DB_ENV *));
*/
-void
+int
__txn_dbenv_create(dbenv)
DB_ENV *dbenv;
{
@@ -50,38 +28,28 @@ __txn_dbenv_create(dbenv)
* state or turn off mutex locking, and so we can neither check
* the panic state or acquire a mutex in the DB_ENV create path.
*/
-
dbenv->tx_max = DEF_MAX_TXNS;
-#ifdef HAVE_RPC
- if (F_ISSET(dbenv, DB_ENV_RPCCLIENT)) {
- dbenv->get_tx_max = __dbcl_get_tx_max;
- dbenv->set_tx_max = __dbcl_set_tx_max;
- dbenv->get_tx_timestamp = __dbcl_get_tx_timestamp;
- dbenv->set_tx_timestamp = __dbcl_set_tx_timestamp;
-
- dbenv->txn_checkpoint = __dbcl_txn_checkpoint;
- dbenv->txn_recover = __dbcl_txn_recover;
- dbenv->txn_stat = __dbcl_txn_stat;
- dbenv->txn_stat_print = NULL;
- dbenv->txn_begin = __dbcl_txn_begin;
- } else
-#endif
- {
- dbenv->get_tx_max = __txn_get_tx_max;
- dbenv->set_tx_max = __txn_set_tx_max;
- dbenv->get_tx_timestamp = __txn_get_tx_timestamp;
- dbenv->set_tx_timestamp = __txn_set_tx_timestamp;
+ return (0);
+}
- dbenv->txn_checkpoint = __txn_checkpoint_pp;
- dbenv->txn_recover = __txn_recover_pp;
- dbenv->txn_stat = __txn_stat_pp;
- dbenv->txn_stat_print = __txn_stat_print_pp;
- dbenv->txn_begin = __txn_begin_pp;
- }
+/*
+ * __txn_dbenv_destroy --
+ * Transaction specific destruction of the DB_ENV structure.
+ *
+ * PUBLIC: void __txn_dbenv_destroy __P((DB_ENV *));
+ */
+void
+__txn_dbenv_destroy(dbenv)
+ DB_ENV *dbenv;
+{
+ COMPQUIET(dbenv, NULL);
}
-static int
+/*
+ * PUBLIC: int __txn_get_tx_max __P((DB_ENV *, u_int32_t *));
+ */
+int
__txn_get_tx_max(dbenv, tx_maxp)
DB_ENV *dbenv;
u_int32_t *tx_maxp;
@@ -92,7 +60,7 @@ __txn_get_tx_max(dbenv, tx_maxp)
if (TXN_ON(dbenv)) {
/* Cannot be set after open, no lock required to read. */
*tx_maxp = ((DB_TXNREGION *)
- ((DB_TXNMGR *)dbenv->tx_handle)->reginfo.primary)->maxtxns;
+ dbenv->tx_handle->reginfo.primary)->maxtxns;
} else
*tx_maxp = dbenv->tx_max;
return (0);
@@ -115,7 +83,10 @@ __txn_set_tx_max(dbenv, tx_max)
return (0);
}
-static int
+/*
+ * PUBLIC: int __txn_get_tx_timestamp __P((DB_ENV *, time_t *));
+ */
+int
__txn_get_tx_timestamp(dbenv, timestamp)
DB_ENV *dbenv;
time_t *timestamp;
@@ -127,8 +98,10 @@ __txn_get_tx_timestamp(dbenv, timestamp)
/*
* __txn_set_tx_timestamp --
* Set the transaction recovery timestamp.
+ *
+ * PUBLIC: int __txn_set_tx_timestamp __P((DB_ENV *, time_t *));
*/
-static int
+int
__txn_set_tx_timestamp(dbenv, timestamp)
DB_ENV *dbenv;
time_t *timestamp;