mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
Remove generated files from bdb source code control.
BitKeeper/deleted/.del-btree_auto.c~a683156a176761f: Delete: bdb/btree/btree_auto.c BitKeeper/deleted/.del-chk.define~aa9a626e58631003: Delete: bdb/dist/build/chk.define BitKeeper/deleted/.del-chk.def~bb65b471d09f7c58: Delete: bdb/dist/build/chk.def BitKeeper/deleted/.del-chk.offt~25759c9294db634e: Delete: bdb/dist/build/chk.offt BitKeeper/deleted/.del-chk.srcfiles~ae884700cd110cbf: Delete: bdb/dist/build/chk.srcfiles BitKeeper/deleted/.del-chk.tags~7a5b14d33d4078cc: Delete: bdb/dist/build/chk.tags BitKeeper/deleted/.del-config.guess~ead1d91caeaa748c: Delete: bdb/dist/config.guess BitKeeper/deleted/.del-config.hin~fdecb7a06fa137a7: Delete: bdb/dist/config.hin BitKeeper/deleted/.del-config.sub~17e9990a298261a: Delete: bdb/dist/config.sub BitKeeper/deleted/.del-crdel_auto.c~ee4146a08fd175c1: Delete: bdb/db/crdel_auto.c BitKeeper/deleted/.del-db_auto.c~3186e950cc321ae7: Delete: bdb/db/db_auto.c BitKeeper/deleted/.del-db_int.h~40ba51edce41403f: Delete: bdb/build_vxworks/db_int.h BitKeeper/deleted/.del-db_int.h~9ee5645850a336a0: Delete: bdb/build_win32/db_int.h BitKeeper/deleted/.del-include.tcl~f8bffb5e2510f229: Delete: bdb/build_win32/include.tcl BitKeeper/deleted/.del-install-sh~1858c24340b72628: Delete: bdb/dist/install-sh BitKeeper/deleted/.del-libdb.rc~906f4936ec6a8398: Delete: bdb/build_win32/libdb.rc BitKeeper/deleted/.del-DbConstants.java~15fa87eda6b72302: Delete: bdb/java/src/com/sleepycat/db/DbConstants.java BitKeeper/deleted/.del-btree_auto.h~84d4451c78faf67e: Delete: bdb/include/btree_auto.h BitKeeper/deleted/.del-crdel_auto.h~1b8255da47550ece: Delete: bdb/include/crdel_auto.h BitKeeper/deleted/.del-db_auto.h~994ddc84db334345: Delete: bdb/include/db_auto.h BitKeeper/deleted/.del-db_server.h~61a33aa05bf368a7: Delete: bdb/include/db_server.h BitKeeper/deleted/.del-db_server_clnt.c~b548b860f765c597: Delete: bdb/rpc_client/db_server_clnt.c BitKeeper/deleted/.del-db_server_svc.c~35804eb82b953f49: Delete: bdb/rpc_server/db_server_svc.c BitKeeper/deleted/.del-gen_client.c~ad86f092d0996a68: Delete: bdb/rpc_client/gen_client.c BitKeeper/deleted/.del-hash_auto.c~d17c6a6ed4f181d1: Delete: bdb/hash/hash_auto.c BitKeeper/deleted/.del-hash_auto.h~1b79cdd426d7ef25: Delete: bdb/include/hash_auto.h BitKeeper/deleted/.del-log_auto.c~fe8c0369965f7151: Delete: bdb/log/log_auto.c BitKeeper/deleted/.del-log_auto.h~8d52dd0884d03051: Delete: bdb/include/log_auto.h BitKeeper/deleted/.del-qam_auto.c~361954d3f149feb0: Delete: bdb/qam/qam_auto.c BitKeeper/deleted/.del-qam_auto.h~96f6c045fd0d6cab: Delete: bdb/include/qam_auto.h BitKeeper/deleted/.del-rec_btree~65d6b0b2f5b7a6d2: Delete: bdb/dist/template/rec_btree BitKeeper/deleted/.del-rec_crdel~58795c0c5232f80d: Delete: bdb/dist/template/rec_crdel BitKeeper/deleted/.del-rec_db~52c5797539878fca: Delete: bdb/dist/template/rec_db BitKeeper/deleted/.del-rec_hash~dcbdd106ae17b865: Delete: bdb/dist/template/rec_hash BitKeeper/deleted/.del-rec_log~3fe6d62c43bc553a: Delete: bdb/dist/template/rec_log BitKeeper/deleted/.del-rec_qam~6eecf6833de0af98: Delete: bdb/dist/template/rec_qam BitKeeper/deleted/.del-rec_txn~1ff22b797deb0e1b: Delete: bdb/dist/template/rec_txn BitKeeper/deleted/.del-txn_auto.h~e3f49e94fd291c45: Delete: bdb/include/txn_auto.h BitKeeper/deleted/.del-db_server_xdr.c~336ef020b4a22c05: Delete: bdb/rpc_server/db_server_xdr.c BitKeeper/deleted/.del-gen_db_server.c~d5602f9bd5c930e: Delete: bdb/rpc_server/gen_db_server.c BitKeeper/deleted/.del-include.tcl~20fc297b040cbe2: Delete: bdb/test/include.tcl BitKeeper/deleted/.del-txn_auto.c~6eb282f016f606d9: Delete: bdb/txn/txn_auto.c
This commit is contained in:
parent
9d10389a12
commit
353d84d874
42 changed files with 0 additions and 24407 deletions
File diff suppressed because it is too large
Load diff
|
@ -1,398 +0,0 @@
|
|||
/* DO NOT EDIT: automatically built by dist/s_vxworks. */
|
||||
/*-
|
||||
* See the file LICENSE for redistribution information.
|
||||
*
|
||||
* Copyright (c) 1996, 1997, 1998, 1999, 2000
|
||||
* Sleepycat Software. All rights reserved.
|
||||
*
|
||||
* $Id: db_int.src,v 11.42 2001/01/11 17:49:17 krinsky Exp $
|
||||
*/
|
||||
|
||||
#ifndef _DB_INTERNAL_H_
|
||||
#define _DB_INTERNAL_H_
|
||||
|
||||
/*******************************************************
|
||||
* General includes.
|
||||
*******************************************************/
|
||||
#include "db.h"
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
#if defined(__STDC__) || defined(__cplusplus)
|
||||
#include <stdarg.h>
|
||||
#else
|
||||
#include <varargs.h>
|
||||
#endif
|
||||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
#include "queue.h"
|
||||
#include "shqueue.h"
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*******************************************************
|
||||
* General purpose constants and macros.
|
||||
*******************************************************/
|
||||
#define UINT16_T_MAX 0xffff /* Maximum 16 bit unsigned. */
|
||||
#define UINT32_T_MAX 0xffffffff /* Maximum 32 bit unsigned. */
|
||||
|
||||
#define MEGABYTE 1048576
|
||||
#define GIGABYTE 1073741824
|
||||
|
||||
#define MS_PER_SEC 1000 /* Milliseconds in a second. */
|
||||
#define USEC_PER_MS 1000 /* Microseconds in a millisecond. */
|
||||
|
||||
#define DB_MIN_PGSIZE 0x000200 /* Minimum page size (512). */
|
||||
#define DB_MAX_PGSIZE 0x010000 /* Maximum page size (65536). */
|
||||
|
||||
#define RECNO_OOB 0 /* Illegal record number. */
|
||||
|
||||
/*
|
||||
* If we are unable to determine the underlying filesystem block size, use
|
||||
* 8K on the grounds that most OS's use less than 8K for a VM page size.
|
||||
*/
|
||||
#define DB_DEF_IOSIZE (8 * 1024)
|
||||
|
||||
/*
|
||||
* Aligning items to particular sizes or in pages or memory.
|
||||
*
|
||||
* db_align_t --
|
||||
* Largest integral type, used to align structures in memory. We don't store
|
||||
* floating point types in structures, so integral types should be sufficient
|
||||
* (and we don't have to worry about systems that store floats in other than
|
||||
* power-of-2 numbers of bytes). Additionally this fixes compiler that rewrite
|
||||
* structure assignments and ANSI C memcpy calls to be in-line instructions
|
||||
* that happen to require alignment. Note: this alignment isn't sufficient for
|
||||
* mutexes, which depend on things like cache line alignment. Mutex alignment
|
||||
* is handled separately, in mutex.h.
|
||||
*
|
||||
* db_alignp_t --
|
||||
* Integral type that's the same size as a pointer. There are places where
|
||||
* DB modifies pointers by discarding the bottom bits to guarantee alignment.
|
||||
* We can't use db_align_t, it may be larger than the pointer, and compilers
|
||||
* get upset about that. So far we haven't run on any machine where there
|
||||
* isn't an integral type the same size as a pointer -- here's hoping.
|
||||
*/
|
||||
typedef unsigned long db_align_t;
|
||||
typedef unsigned long db_alignp_t;
|
||||
|
||||
/* Align an integer to a specific boundary. */
|
||||
#undef ALIGN
|
||||
#define ALIGN(value, bound) \
|
||||
(((value) + (bound) - 1) & ~(((u_int)bound) - 1))
|
||||
|
||||
/* Align a pointer to a specific boundary. */
|
||||
#undef ALIGNP
|
||||
#define ALIGNP(value, bound) ALIGN((db_alignp_t)value, bound)
|
||||
|
||||
/*
|
||||
* There are several on-page structures that are declared to have a number of
|
||||
* fields followed by a variable length array of items. The structure size
|
||||
* without including the variable length array or the address of the first of
|
||||
* those elements can be found using SSZ.
|
||||
*
|
||||
* This macro can also be used to find the offset of a structure element in a
|
||||
* structure. This is used in various places to copy structure elements from
|
||||
* unaligned memory references, e.g., pointers into a packed page.
|
||||
*
|
||||
* There are two versions because compilers object if you take the address of
|
||||
* an array.
|
||||
*/
|
||||
#undef SSZ
|
||||
#define SSZ(name, field) ((int)&(((name *)0)->field))
|
||||
|
||||
#undef SSZA
|
||||
#define SSZA(name, field) ((int)&(((name *)0)->field[0]))
|
||||
|
||||
/*
|
||||
* Print an address as a u_long (a u_long is the largest type we can print
|
||||
* portably). Most 64-bit systems have made longs 64-bits, so this should
|
||||
* work.
|
||||
*/
|
||||
#define P_TO_ULONG(p) ((u_long)(db_alignp_t)(p))
|
||||
|
||||
/* Structure used to print flag values. */
|
||||
typedef struct __fn {
|
||||
u_int32_t mask; /* Flag value. */
|
||||
const char *name; /* Flag name. */
|
||||
} FN;
|
||||
|
||||
/* Set, clear and test flags. */
|
||||
#define FLD_CLR(fld, f) (fld) &= ~(f)
|
||||
#define FLD_ISSET(fld, f) ((fld) & (f))
|
||||
#define FLD_SET(fld, f) (fld) |= (f)
|
||||
#define F_CLR(p, f) (p)->flags &= ~(f)
|
||||
#define F_ISSET(p, f) ((p)->flags & (f))
|
||||
#define F_SET(p, f) (p)->flags |= (f)
|
||||
#define LF_CLR(f) (flags &= ~(f))
|
||||
#define LF_ISSET(f) (flags & (f))
|
||||
#define LF_SET(f) (flags |= (f))
|
||||
|
||||
/* Display separator string. */
|
||||
#undef DB_LINE
|
||||
#define DB_LINE "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="
|
||||
|
||||
/* Unused, or not-used-yet variable. "Shut that bloody compiler up!" */
|
||||
#define COMPQUIET(n, v) (n) = (v)
|
||||
|
||||
/*******************************************************
|
||||
* Files.
|
||||
*******************************************************/
|
||||
/*
|
||||
* We use 1024 as the maximum path length. It's too hard to figure out what
|
||||
* the real path length is, as it was traditionally stored in <sys/param.h>,
|
||||
* and that file isn't always available.
|
||||
*/
|
||||
#undef MAXPATHLEN
|
||||
#define MAXPATHLEN 1024
|
||||
|
||||
#define PATH_DOT "." /* Current working directory. */
|
||||
#define PATH_SEPARATOR "/\\" /* Path separator character. */
|
||||
|
||||
/*
|
||||
* Flags understood by __os_open.
|
||||
*/
|
||||
#define DB_OSO_CREATE 0x001 /* POSIX: O_CREAT */
|
||||
#define DB_OSO_EXCL 0x002 /* POSIX: O_EXCL */
|
||||
#define DB_OSO_LOG 0x004 /* Opening a log file. */
|
||||
#define DB_OSO_RDONLY 0x008 /* POSIX: O_RDONLY */
|
||||
#define DB_OSO_REGION 0x010 /* Opening a region file. */
|
||||
#define DB_OSO_SEQ 0x020 /* Expected sequential access. */
|
||||
#define DB_OSO_TEMP 0x040 /* Remove after last close. */
|
||||
#define DB_OSO_TRUNC 0x080 /* POSIX: O_TRUNC */
|
||||
|
||||
/*
|
||||
* Seek options understood by __os_seek.
|
||||
*/
|
||||
typedef enum {
|
||||
DB_OS_SEEK_CUR, /* POSIX: SEEK_CUR */
|
||||
DB_OS_SEEK_END, /* POSIX: SEEK_END */
|
||||
DB_OS_SEEK_SET /* POSIX: SEEK_SET */
|
||||
} DB_OS_SEEK;
|
||||
|
||||
/*******************************************************
|
||||
* Environment.
|
||||
*******************************************************/
|
||||
/* Type passed to __db_appname(). */
|
||||
typedef enum {
|
||||
DB_APP_NONE=0, /* No type (region). */
|
||||
DB_APP_DATA, /* Data file. */
|
||||
DB_APP_LOG, /* Log file. */
|
||||
DB_APP_TMP /* Temporary file. */
|
||||
} APPNAME;
|
||||
|
||||
/*
|
||||
* CDB_LOCKING CDB product locking.
|
||||
* LOCKING_ON Locking has been configured.
|
||||
* LOGGING_ON Logging has been configured.
|
||||
* MPOOL_ON Memory pool has been configured.
|
||||
* TXN_ON Transactions have been configured.
|
||||
*/
|
||||
#define CDB_LOCKING(dbenv) F_ISSET(dbenv, DB_ENV_CDB)
|
||||
#define LOCKING_ON(dbenv) ((dbenv)->lk_handle != NULL)
|
||||
#define LOGGING_ON(dbenv) ((dbenv)->lg_handle != NULL)
|
||||
#define MPOOL_ON(dbenv) ((dbenv)->mp_handle != NULL)
|
||||
#define TXN_ON(dbenv) ((dbenv)->tx_handle != NULL)
|
||||
|
||||
/*
|
||||
* STD_LOCKING Standard locking, that is, locking was configured and CDB
|
||||
* was not. We do not do locking in off-page duplicate trees,
|
||||
* so we check for that in the cursor first.
|
||||
*/
|
||||
#define STD_LOCKING(dbc) \
|
||||
(!F_ISSET(dbc, DBC_OPD) && \
|
||||
!CDB_LOCKING((dbc)->dbp->dbenv) && LOCKING_ON((dbc)->dbp->dbenv))
|
||||
|
||||
/*
|
||||
* IS_RECOVERING The system is running recovery.
|
||||
*/
|
||||
#define IS_RECOVERING(dbenv) \
|
||||
(LOGGING_ON(dbenv) && \
|
||||
F_ISSET((DB_LOG *)(dbenv)->lg_handle, DBLOG_RECOVER))
|
||||
|
||||
/* Most initialization methods cannot be called after open is called. */
|
||||
#define ENV_ILLEGAL_AFTER_OPEN(dbenv, name) \
|
||||
if (F_ISSET((dbenv), DB_ENV_OPEN_CALLED)) \
|
||||
return (__db_mi_open(dbenv, name, 1));
|
||||
|
||||
/* We're not actually user hostile, honest. */
|
||||
#define ENV_REQUIRES_CONFIG(dbenv, handle, subsystem) \
|
||||
if (handle == NULL) \
|
||||
return (__db_env_config(dbenv, subsystem));
|
||||
|
||||
/*******************************************************
|
||||
* Database Access Methods.
|
||||
*******************************************************/
|
||||
/*
|
||||
* DB_IS_THREADED --
|
||||
* The database handle is free-threaded (was opened with DB_THREAD).
|
||||
*/
|
||||
#define DB_IS_THREADED(dbp) \
|
||||
((dbp)->mutexp != NULL)
|
||||
|
||||
/* Initialization methods are often illegal before/after open is called. */
|
||||
#define DB_ILLEGAL_AFTER_OPEN(dbp, name) \
|
||||
if (F_ISSET((dbp), DB_OPEN_CALLED)) \
|
||||
return (__db_mi_open(dbp->dbenv, name, 1));
|
||||
#define DB_ILLEGAL_BEFORE_OPEN(dbp, name) \
|
||||
if (!F_ISSET((dbp), DB_OPEN_CALLED)) \
|
||||
return (__db_mi_open(dbp->dbenv, name, 0));
|
||||
/* Some initialization methods are illegal if environment isn't local. */
|
||||
#define DB_ILLEGAL_IN_ENV(dbp, name) \
|
||||
if (!F_ISSET(dbp->dbenv, DB_ENV_DBLOCAL)) \
|
||||
return (__db_mi_env(dbp->dbenv, name));
|
||||
#define DB_ILLEGAL_METHOD(dbp, flags) { \
|
||||
int __ret; \
|
||||
if ((__ret = __dbh_am_chk(dbp, flags)) != 0) \
|
||||
return (__ret); \
|
||||
}
|
||||
|
||||
/*
|
||||
* Common DBC->internal fields. Each access method adds additional fields
|
||||
* to this list, but the initial fields are common.
|
||||
*/
|
||||
#define __DBC_INTERNAL \
|
||||
DBC *opd; /* Off-page duplicate cursor. */\
|
||||
\
|
||||
void *page; /* Referenced page. */ \
|
||||
db_pgno_t root; /* Tree root. */ \
|
||||
db_pgno_t pgno; /* Referenced page number. */ \
|
||||
db_indx_t indx; /* Referenced key item index. */\
|
||||
\
|
||||
DB_LOCK lock; /* Cursor lock. */ \
|
||||
db_lockmode_t lock_mode; /* Lock mode. */
|
||||
|
||||
struct __dbc_internal {
|
||||
__DBC_INTERNAL
|
||||
};
|
||||
|
||||
/*
|
||||
* Access-method-common macro for determining whether a cursor
|
||||
* has been initialized.
|
||||
*/
|
||||
#define IS_INITIALIZED(dbc) ((dbc)->internal->pgno != PGNO_INVALID)
|
||||
|
||||
/*******************************************************
|
||||
* Mpool.
|
||||
*******************************************************/
|
||||
/*
|
||||
* File types for DB access methods. Negative numbers are reserved to DB.
|
||||
*/
|
||||
#define DB_FTYPE_SET -1 /* Call pgin/pgout functions. */
|
||||
#define DB_FTYPE_NOTSET 0 /* Don't call... */
|
||||
|
||||
/* Structure used as the DB pgin/pgout pgcookie. */
|
||||
typedef struct __dbpginfo {
|
||||
size_t db_pagesize; /* Underlying page size. */
|
||||
int needswap; /* If swapping required. */
|
||||
} DB_PGINFO;
|
||||
|
||||
/*******************************************************
|
||||
* Log.
|
||||
*******************************************************/
|
||||
/* Initialize an LSN to 'zero'. */
|
||||
#define ZERO_LSN(LSN) do { \
|
||||
(LSN).file = 0; \
|
||||
(LSN).offset = 0; \
|
||||
} while (0)
|
||||
|
||||
/* Return 1 if LSN is a 'zero' lsn, otherwise return 0. */
|
||||
#define IS_ZERO_LSN(LSN) ((LSN).file == 0)
|
||||
|
||||
/* Test if we need to log a change. */
|
||||
#define DB_LOGGING(dbc) \
|
||||
(LOGGING_ON((dbc)->dbp->dbenv) && !F_ISSET(dbc, DBC_RECOVER))
|
||||
|
||||
/* Internal flag for use with internal __log_unregister. */
|
||||
#define DB_LOGONLY 0x01
|
||||
/*******************************************************
|
||||
* Txn.
|
||||
*******************************************************/
|
||||
#define DB_NONBLOCK(C) ((C)->txn != NULL && F_ISSET((C)->txn, TXN_NOWAIT))
|
||||
#define IS_SUBTRANSACTION(txn) \
|
||||
((txn) != NULL && (txn)->parent != NULL)
|
||||
|
||||
/*******************************************************
|
||||
* Global variables.
|
||||
*******************************************************/
|
||||
#ifdef HAVE_VXWORKS
|
||||
#include "semLib.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DB global variables. Done in a single structure to minimize the name-space
|
||||
* pollution.
|
||||
*/
|
||||
typedef struct __db_globals {
|
||||
u_int32_t db_pageyield; /* db_set_pageyield */
|
||||
u_int32_t db_panic; /* db_set_panic */
|
||||
u_int32_t db_region_init; /* db_set_region_init */
|
||||
u_int32_t db_tas_spins; /* db_set_tas_spins */
|
||||
#ifdef HAVE_VXWORKS
|
||||
u_int32_t db_global_init; /* VxWorks: inited */
|
||||
SEM_ID db_global_lock; /* VxWorks: global semaphore */
|
||||
#endif
|
||||
/* XA: list of opened environments. */
|
||||
TAILQ_HEAD(__db_envq, __db_env) db_envq;
|
||||
} DB_GLOBALS;
|
||||
|
||||
#ifdef DB_INITIALIZE_DB_GLOBALS
|
||||
DB_GLOBALS __db_global_values = {
|
||||
0, /* db_set_pageyield */
|
||||
1, /* db_set_panic */
|
||||
0, /* db_set_region_init */
|
||||
0, /* db_set_tas_spins */
|
||||
#ifdef HAVE_VXWORKS
|
||||
0, /* db_global_init */
|
||||
NULL, /* db_global_lock */
|
||||
#endif
|
||||
/* XA environment queue */
|
||||
{NULL, &__db_global_values.db_envq.tqh_first}
|
||||
};
|
||||
#else
|
||||
extern DB_GLOBALS __db_global_values;
|
||||
#endif
|
||||
#define DB_GLOBAL(v) __db_global_values.v
|
||||
|
||||
/* Forward structure declarations. */
|
||||
struct __db_reginfo_t; typedef struct __db_reginfo_t REGINFO;
|
||||
struct __mutex_t; typedef struct __mutex_t MUTEX;
|
||||
struct __vrfy_childinfo; typedef struct __vrfy_childinfo VRFY_CHILDINFO;
|
||||
struct __vrfy_dbinfo; typedef struct __vrfy_dbinfo VRFY_DBINFO;
|
||||
struct __vrfy_pageinfo; typedef struct __vrfy_pageinfo VRFY_PAGEINFO;
|
||||
struct __db_txnlist; typedef struct __db_txnlist DB_TXNLIST;
|
||||
struct __db_txnhead; typedef struct __db_txnhead DB_TXNHEAD;
|
||||
typedef enum {
|
||||
TXNLIST_DELETE,
|
||||
TXNLIST_LSN,
|
||||
TXNLIST_TXNID,
|
||||
TXNLIST_PGNO
|
||||
} db_txnlist_type;
|
||||
|
||||
/*
|
||||
* Currently, region offsets are limited to 32-bits. I expect that's going
|
||||
* to have to be fixed in the not-too-distant future, since we won't want to
|
||||
* split 100Gb memory pools into that many different regions. It's typedef'd
|
||||
* so it won't be too painful to upgrade.
|
||||
*/
|
||||
typedef u_int32_t roff_t;
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
/*******************************************************
|
||||
* More general includes.
|
||||
*******************************************************/
|
||||
#include "debug.h"
|
||||
#include "mutex.h"
|
||||
#include "region.h"
|
||||
#include "mutex_ext.h"
|
||||
#include "env_ext.h"
|
||||
#include "os.h"
|
||||
#include "os_ext.h"
|
||||
#include "common_ext.h"
|
||||
|
||||
#endif /* !_DB_INTERNAL_H_ */
|
|
@ -1,398 +0,0 @@
|
|||
/* DO NOT EDIT: automatically built by dist/s_win32. */
|
||||
/*-
|
||||
* See the file LICENSE for redistribution information.
|
||||
*
|
||||
* Copyright (c) 1996, 1997, 1998, 1999, 2000
|
||||
* Sleepycat Software. All rights reserved.
|
||||
*
|
||||
* $Id: db_int.src,v 11.42 2001/01/11 17:49:17 krinsky Exp $
|
||||
*/
|
||||
|
||||
#ifndef _DB_INTERNAL_H_
|
||||
#define _DB_INTERNAL_H_
|
||||
|
||||
/*******************************************************
|
||||
* General includes.
|
||||
*******************************************************/
|
||||
#include "db.h"
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
#if defined(__STDC__) || defined(__cplusplus)
|
||||
#include <stdarg.h>
|
||||
#else
|
||||
#include <varargs.h>
|
||||
#endif
|
||||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
#include "queue.h"
|
||||
#include "shqueue.h"
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*******************************************************
|
||||
* General purpose constants and macros.
|
||||
*******************************************************/
|
||||
#define UINT16_T_MAX 0xffff /* Maximum 16 bit unsigned. */
|
||||
#define UINT32_T_MAX 0xffffffff /* Maximum 32 bit unsigned. */
|
||||
|
||||
#define MEGABYTE 1048576
|
||||
#define GIGABYTE 1073741824
|
||||
|
||||
#define MS_PER_SEC 1000 /* Milliseconds in a second. */
|
||||
#define USEC_PER_MS 1000 /* Microseconds in a millisecond. */
|
||||
|
||||
#define DB_MIN_PGSIZE 0x000200 /* Minimum page size (512). */
|
||||
#define DB_MAX_PGSIZE 0x010000 /* Maximum page size (65536). */
|
||||
|
||||
#define RECNO_OOB 0 /* Illegal record number. */
|
||||
|
||||
/*
|
||||
* If we are unable to determine the underlying filesystem block size, use
|
||||
* 8K on the grounds that most OS's use less than 8K for a VM page size.
|
||||
*/
|
||||
#define DB_DEF_IOSIZE (8 * 1024)
|
||||
|
||||
/*
|
||||
* Aligning items to particular sizes or in pages or memory.
|
||||
*
|
||||
* db_align_t --
|
||||
* Largest integral type, used to align structures in memory. We don't store
|
||||
* floating point types in structures, so integral types should be sufficient
|
||||
* (and we don't have to worry about systems that store floats in other than
|
||||
* power-of-2 numbers of bytes). Additionally this fixes compiler that rewrite
|
||||
* structure assignments and ANSI C memcpy calls to be in-line instructions
|
||||
* that happen to require alignment. Note: this alignment isn't sufficient for
|
||||
* mutexes, which depend on things like cache line alignment. Mutex alignment
|
||||
* is handled separately, in mutex.h.
|
||||
*
|
||||
* db_alignp_t --
|
||||
* Integral type that's the same size as a pointer. There are places where
|
||||
* DB modifies pointers by discarding the bottom bits to guarantee alignment.
|
||||
* We can't use db_align_t, it may be larger than the pointer, and compilers
|
||||
* get upset about that. So far we haven't run on any machine where there
|
||||
* isn't an integral type the same size as a pointer -- here's hoping.
|
||||
*/
|
||||
typedef unsigned long db_align_t;
|
||||
typedef unsigned long db_alignp_t;
|
||||
|
||||
/* Align an integer to a specific boundary. */
|
||||
#undef ALIGN
|
||||
#define ALIGN(value, bound) \
|
||||
(((value) + (bound) - 1) & ~(((u_int)bound) - 1))
|
||||
|
||||
/* Align a pointer to a specific boundary. */
|
||||
#undef ALIGNP
|
||||
#define ALIGNP(value, bound) ALIGN((db_alignp_t)value, bound)
|
||||
|
||||
/*
|
||||
* There are several on-page structures that are declared to have a number of
|
||||
* fields followed by a variable length array of items. The structure size
|
||||
* without including the variable length array or the address of the first of
|
||||
* those elements can be found using SSZ.
|
||||
*
|
||||
* This macro can also be used to find the offset of a structure element in a
|
||||
* structure. This is used in various places to copy structure elements from
|
||||
* unaligned memory references, e.g., pointers into a packed page.
|
||||
*
|
||||
* There are two versions because compilers object if you take the address of
|
||||
* an array.
|
||||
*/
|
||||
#undef SSZ
|
||||
#define SSZ(name, field) ((int)&(((name *)0)->field))
|
||||
|
||||
#undef SSZA
|
||||
#define SSZA(name, field) ((int)&(((name *)0)->field[0]))
|
||||
|
||||
/*
|
||||
* Print an address as a u_long (a u_long is the largest type we can print
|
||||
* portably). Most 64-bit systems have made longs 64-bits, so this should
|
||||
* work.
|
||||
*/
|
||||
#define P_TO_ULONG(p) ((u_long)(db_alignp_t)(p))
|
||||
|
||||
/* Structure used to print flag values. */
|
||||
typedef struct __fn {
|
||||
u_int32_t mask; /* Flag value. */
|
||||
const char *name; /* Flag name. */
|
||||
} FN;
|
||||
|
||||
/* Set, clear and test flags. */
|
||||
#define FLD_CLR(fld, f) (fld) &= ~(f)
|
||||
#define FLD_ISSET(fld, f) ((fld) & (f))
|
||||
#define FLD_SET(fld, f) (fld) |= (f)
|
||||
#define F_CLR(p, f) (p)->flags &= ~(f)
|
||||
#define F_ISSET(p, f) ((p)->flags & (f))
|
||||
#define F_SET(p, f) (p)->flags |= (f)
|
||||
#define LF_CLR(f) (flags &= ~(f))
|
||||
#define LF_ISSET(f) (flags & (f))
|
||||
#define LF_SET(f) (flags |= (f))
|
||||
|
||||
/* Display separator string. */
|
||||
#undef DB_LINE
|
||||
#define DB_LINE "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="
|
||||
|
||||
/* Unused, or not-used-yet variable. "Shut that bloody compiler up!" */
|
||||
#define COMPQUIET(n, v) (n) = (v)
|
||||
|
||||
/*******************************************************
|
||||
* Files.
|
||||
*******************************************************/
|
||||
/*
|
||||
* We use 1024 as the maximum path length. It's too hard to figure out what
|
||||
* the real path length is, as it was traditionally stored in <sys/param.h>,
|
||||
* and that file isn't always available.
|
||||
*/
|
||||
#undef MAXPATHLEN
|
||||
#define MAXPATHLEN 1024
|
||||
|
||||
#define PATH_DOT "." /* Current working directory. */
|
||||
#define PATH_SEPARATOR "\\/:" /* Path separator character. */
|
||||
|
||||
/*
|
||||
* Flags understood by __os_open.
|
||||
*/
|
||||
#define DB_OSO_CREATE 0x001 /* POSIX: O_CREAT */
|
||||
#define DB_OSO_EXCL 0x002 /* POSIX: O_EXCL */
|
||||
#define DB_OSO_LOG 0x004 /* Opening a log file. */
|
||||
#define DB_OSO_RDONLY 0x008 /* POSIX: O_RDONLY */
|
||||
#define DB_OSO_REGION 0x010 /* Opening a region file. */
|
||||
#define DB_OSO_SEQ 0x020 /* Expected sequential access. */
|
||||
#define DB_OSO_TEMP 0x040 /* Remove after last close. */
|
||||
#define DB_OSO_TRUNC 0x080 /* POSIX: O_TRUNC */
|
||||
|
||||
/*
|
||||
* Seek options understood by __os_seek.
|
||||
*/
|
||||
typedef enum {
|
||||
DB_OS_SEEK_CUR, /* POSIX: SEEK_CUR */
|
||||
DB_OS_SEEK_END, /* POSIX: SEEK_END */
|
||||
DB_OS_SEEK_SET /* POSIX: SEEK_SET */
|
||||
} DB_OS_SEEK;
|
||||
|
||||
/*******************************************************
|
||||
* Environment.
|
||||
*******************************************************/
|
||||
/* Type passed to __db_appname(). */
|
||||
typedef enum {
|
||||
DB_APP_NONE=0, /* No type (region). */
|
||||
DB_APP_DATA, /* Data file. */
|
||||
DB_APP_LOG, /* Log file. */
|
||||
DB_APP_TMP /* Temporary file. */
|
||||
} APPNAME;
|
||||
|
||||
/*
|
||||
* CDB_LOCKING CDB product locking.
|
||||
* LOCKING_ON Locking has been configured.
|
||||
* LOGGING_ON Logging has been configured.
|
||||
* MPOOL_ON Memory pool has been configured.
|
||||
* TXN_ON Transactions have been configured.
|
||||
*/
|
||||
#define CDB_LOCKING(dbenv) F_ISSET(dbenv, DB_ENV_CDB)
|
||||
#define LOCKING_ON(dbenv) ((dbenv)->lk_handle != NULL)
|
||||
#define LOGGING_ON(dbenv) ((dbenv)->lg_handle != NULL)
|
||||
#define MPOOL_ON(dbenv) ((dbenv)->mp_handle != NULL)
|
||||
#define TXN_ON(dbenv) ((dbenv)->tx_handle != NULL)
|
||||
|
||||
/*
|
||||
* STD_LOCKING Standard locking, that is, locking was configured and CDB
|
||||
* was not. We do not do locking in off-page duplicate trees,
|
||||
* so we check for that in the cursor first.
|
||||
*/
|
||||
#define STD_LOCKING(dbc) \
|
||||
(!F_ISSET(dbc, DBC_OPD) && \
|
||||
!CDB_LOCKING((dbc)->dbp->dbenv) && LOCKING_ON((dbc)->dbp->dbenv))
|
||||
|
||||
/*
|
||||
* IS_RECOVERING The system is running recovery.
|
||||
*/
|
||||
#define IS_RECOVERING(dbenv) \
|
||||
(LOGGING_ON(dbenv) && \
|
||||
F_ISSET((DB_LOG *)(dbenv)->lg_handle, DBLOG_RECOVER))
|
||||
|
||||
/* Most initialization methods cannot be called after open is called. */
|
||||
#define ENV_ILLEGAL_AFTER_OPEN(dbenv, name) \
|
||||
if (F_ISSET((dbenv), DB_ENV_OPEN_CALLED)) \
|
||||
return (__db_mi_open(dbenv, name, 1));
|
||||
|
||||
/* We're not actually user hostile, honest. */
|
||||
#define ENV_REQUIRES_CONFIG(dbenv, handle, subsystem) \
|
||||
if (handle == NULL) \
|
||||
return (__db_env_config(dbenv, subsystem));
|
||||
|
||||
/*******************************************************
|
||||
* Database Access Methods.
|
||||
*******************************************************/
|
||||
/*
|
||||
* DB_IS_THREADED --
|
||||
* The database handle is free-threaded (was opened with DB_THREAD).
|
||||
*/
|
||||
#define DB_IS_THREADED(dbp) \
|
||||
((dbp)->mutexp != NULL)
|
||||
|
||||
/* Initialization methods are often illegal before/after open is called. */
|
||||
#define DB_ILLEGAL_AFTER_OPEN(dbp, name) \
|
||||
if (F_ISSET((dbp), DB_OPEN_CALLED)) \
|
||||
return (__db_mi_open(dbp->dbenv, name, 1));
|
||||
#define DB_ILLEGAL_BEFORE_OPEN(dbp, name) \
|
||||
if (!F_ISSET((dbp), DB_OPEN_CALLED)) \
|
||||
return (__db_mi_open(dbp->dbenv, name, 0));
|
||||
/* Some initialization methods are illegal if environment isn't local. */
|
||||
#define DB_ILLEGAL_IN_ENV(dbp, name) \
|
||||
if (!F_ISSET(dbp->dbenv, DB_ENV_DBLOCAL)) \
|
||||
return (__db_mi_env(dbp->dbenv, name));
|
||||
#define DB_ILLEGAL_METHOD(dbp, flags) { \
|
||||
int __ret; \
|
||||
if ((__ret = __dbh_am_chk(dbp, flags)) != 0) \
|
||||
return (__ret); \
|
||||
}
|
||||
|
||||
/*
|
||||
* Common DBC->internal fields. Each access method adds additional fields
|
||||
* to this list, but the initial fields are common.
|
||||
*/
|
||||
#define __DBC_INTERNAL \
|
||||
DBC *opd; /* Off-page duplicate cursor. */\
|
||||
\
|
||||
void *page; /* Referenced page. */ \
|
||||
db_pgno_t root; /* Tree root. */ \
|
||||
db_pgno_t pgno; /* Referenced page number. */ \
|
||||
db_indx_t indx; /* Referenced key item index. */\
|
||||
\
|
||||
DB_LOCK lock; /* Cursor lock. */ \
|
||||
db_lockmode_t lock_mode; /* Lock mode. */
|
||||
|
||||
struct __dbc_internal {
|
||||
__DBC_INTERNAL
|
||||
};
|
||||
|
||||
/*
|
||||
* Access-method-common macro for determining whether a cursor
|
||||
* has been initialized.
|
||||
*/
|
||||
#define IS_INITIALIZED(dbc) ((dbc)->internal->pgno != PGNO_INVALID)
|
||||
|
||||
/*******************************************************
|
||||
* Mpool.
|
||||
*******************************************************/
|
||||
/*
|
||||
* File types for DB access methods. Negative numbers are reserved to DB.
|
||||
*/
|
||||
#define DB_FTYPE_SET -1 /* Call pgin/pgout functions. */
|
||||
#define DB_FTYPE_NOTSET 0 /* Don't call... */
|
||||
|
||||
/* Structure used as the DB pgin/pgout pgcookie. */
|
||||
typedef struct __dbpginfo {
|
||||
size_t db_pagesize; /* Underlying page size. */
|
||||
int needswap; /* If swapping required. */
|
||||
} DB_PGINFO;
|
||||
|
||||
/*******************************************************
|
||||
* Log.
|
||||
*******************************************************/
|
||||
/* Initialize an LSN to 'zero'. */
|
||||
#define ZERO_LSN(LSN) do { \
|
||||
(LSN).file = 0; \
|
||||
(LSN).offset = 0; \
|
||||
} while (0)
|
||||
|
||||
/* Return 1 if LSN is a 'zero' lsn, otherwise return 0. */
|
||||
#define IS_ZERO_LSN(LSN) ((LSN).file == 0)
|
||||
|
||||
/* Test if we need to log a change. */
|
||||
#define DB_LOGGING(dbc) \
|
||||
(LOGGING_ON((dbc)->dbp->dbenv) && !F_ISSET(dbc, DBC_RECOVER))
|
||||
|
||||
/* Internal flag for use with internal __log_unregister. */
|
||||
#define DB_LOGONLY 0x01
|
||||
/*******************************************************
|
||||
* Txn.
|
||||
*******************************************************/
|
||||
#define DB_NONBLOCK(C) ((C)->txn != NULL && F_ISSET((C)->txn, TXN_NOWAIT))
|
||||
#define IS_SUBTRANSACTION(txn) \
|
||||
((txn) != NULL && (txn)->parent != NULL)
|
||||
|
||||
/*******************************************************
|
||||
* Global variables.
|
||||
*******************************************************/
|
||||
#ifdef HAVE_VXWORKS
|
||||
#include "semLib.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DB global variables. Done in a single structure to minimize the name-space
|
||||
* pollution.
|
||||
*/
|
||||
typedef struct __db_globals {
|
||||
u_int32_t db_pageyield; /* db_set_pageyield */
|
||||
u_int32_t db_panic; /* db_set_panic */
|
||||
u_int32_t db_region_init; /* db_set_region_init */
|
||||
u_int32_t db_tas_spins; /* db_set_tas_spins */
|
||||
#ifdef HAVE_VXWORKS
|
||||
u_int32_t db_global_init; /* VxWorks: inited */
|
||||
SEM_ID db_global_lock; /* VxWorks: global semaphore */
|
||||
#endif
|
||||
/* XA: list of opened environments. */
|
||||
TAILQ_HEAD(__db_envq, __db_env) db_envq;
|
||||
} DB_GLOBALS;
|
||||
|
||||
#ifdef DB_INITIALIZE_DB_GLOBALS
|
||||
DB_GLOBALS __db_global_values = {
|
||||
0, /* db_set_pageyield */
|
||||
1, /* db_set_panic */
|
||||
0, /* db_set_region_init */
|
||||
0, /* db_set_tas_spins */
|
||||
#ifdef HAVE_VXWORKS
|
||||
0, /* db_global_init */
|
||||
NULL, /* db_global_lock */
|
||||
#endif
|
||||
/* XA environment queue */
|
||||
{NULL, &__db_global_values.db_envq.tqh_first}
|
||||
};
|
||||
#else
|
||||
extern DB_GLOBALS __db_global_values;
|
||||
#endif
|
||||
#define DB_GLOBAL(v) __db_global_values.v
|
||||
|
||||
/* Forward structure declarations. */
|
||||
struct __db_reginfo_t; typedef struct __db_reginfo_t REGINFO;
|
||||
struct __mutex_t; typedef struct __mutex_t MUTEX;
|
||||
struct __vrfy_childinfo; typedef struct __vrfy_childinfo VRFY_CHILDINFO;
|
||||
struct __vrfy_dbinfo; typedef struct __vrfy_dbinfo VRFY_DBINFO;
|
||||
struct __vrfy_pageinfo; typedef struct __vrfy_pageinfo VRFY_PAGEINFO;
|
||||
struct __db_txnlist; typedef struct __db_txnlist DB_TXNLIST;
|
||||
struct __db_txnhead; typedef struct __db_txnhead DB_TXNHEAD;
|
||||
typedef enum {
|
||||
TXNLIST_DELETE,
|
||||
TXNLIST_LSN,
|
||||
TXNLIST_TXNID,
|
||||
TXNLIST_PGNO
|
||||
} db_txnlist_type;
|
||||
|
||||
/*
|
||||
* Currently, region offsets are limited to 32-bits. I expect that's going
|
||||
* to have to be fixed in the not-too-distant future, since we won't want to
|
||||
* split 100Gb memory pools into that many different regions. It's typedef'd
|
||||
* so it won't be too painful to upgrade.
|
||||
*/
|
||||
typedef u_int32_t roff_t;
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
/*******************************************************
|
||||
* More general includes.
|
||||
*******************************************************/
|
||||
#include "debug.h"
|
||||
#include "mutex.h"
|
||||
#include "region.h"
|
||||
#include "mutex_ext.h"
|
||||
#include "env_ext.h"
|
||||
#include "os.h"
|
||||
#include "os_ext.h"
|
||||
#include "common_ext.h"
|
||||
|
||||
#endif /* !_DB_INTERNAL_H_ */
|
|
@ -1,16 +0,0 @@
|
|||
set tclsh_path SET_YOUR_TCLSH_PATH
|
||||
set test_path ../test
|
||||
set tcllib ./Debug/libdb_tcl32d.dll
|
||||
|
||||
set KILL ./dbkill.exe
|
||||
|
||||
# DO NOT EDIT BELOW THIS LINE: automatically built by dist/s_tcl.
|
||||
|
||||
global dict
|
||||
global testdir
|
||||
global util_path
|
||||
set testdir ./TESTDIR
|
||||
|
||||
global is_hp_test
|
||||
global is_qnx_test
|
||||
global is_windows_test
|
|
@ -1,33 +0,0 @@
|
|||
1 VERSIONINFO
|
||||
FILEVERSION 3,0,2,9
|
||||
PRODUCTVERSION 3,0,2,9
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x2L
|
||||
FILESUBTYPE 0x0L
|
||||
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "Sleepycat Software\0"
|
||||
VALUE "FileDescription", "Berkeley DB 3.0 DLL\0"
|
||||
VALUE "FileVersion", "3.2.9\0"
|
||||
VALUE "InternalName", "libdb.dll\0"
|
||||
VALUE "LegalCopyright", "Copyright © Sleepycat Software Inc. 1997, 1998, 1999, 2000\0"
|
||||
VALUE "OriginalFilename", "libdb.dll\0"
|
||||
VALUE "ProductName", "Sleepycat Software libdb\0"
|
||||
VALUE "ProductVersion", "3.2.9\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
|
@ -1,900 +0,0 @@
|
|||
/* Do not edit: automatically built by gen_rec.awk. */
|
||||
#include "db_config.h"
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#include "db_int.h"
|
||||
#include "db_page.h"
|
||||
#include "db_dispatch.h"
|
||||
#include "db_am.h"
|
||||
#include "txn.h"
|
||||
|
||||
int
|
||||
__crdel_fileopen_log(dbenv, txnid, ret_lsnp, flags,
|
||||
name, mode)
|
||||
DB_ENV *dbenv;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN *ret_lsnp;
|
||||
u_int32_t flags;
|
||||
const DBT *name;
|
||||
u_int32_t mode;
|
||||
{
|
||||
DBT logrec;
|
||||
DB_LSN *lsnp, null_lsn;
|
||||
u_int32_t zero;
|
||||
u_int32_t rectype, txn_num;
|
||||
int ret;
|
||||
u_int8_t *bp;
|
||||
|
||||
rectype = DB_crdel_fileopen;
|
||||
if (txnid != NULL &&
|
||||
TAILQ_FIRST(&txnid->kids) != NULL &&
|
||||
(ret = __txn_activekids(dbenv, rectype, txnid)) != 0)
|
||||
return (ret);
|
||||
txn_num = txnid == NULL ? 0 : txnid->txnid;
|
||||
if (txnid == NULL) {
|
||||
ZERO_LSN(null_lsn);
|
||||
lsnp = &null_lsn;
|
||||
} else
|
||||
lsnp = &txnid->last_lsn;
|
||||
logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
|
||||
+ sizeof(u_int32_t) + (name == NULL ? 0 : name->size)
|
||||
+ sizeof(mode);
|
||||
if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0)
|
||||
return (ret);
|
||||
|
||||
bp = logrec.data;
|
||||
memcpy(bp, &rectype, sizeof(rectype));
|
||||
bp += sizeof(rectype);
|
||||
memcpy(bp, &txn_num, sizeof(txn_num));
|
||||
bp += sizeof(txn_num);
|
||||
memcpy(bp, lsnp, sizeof(DB_LSN));
|
||||
bp += sizeof(DB_LSN);
|
||||
if (name == NULL) {
|
||||
zero = 0;
|
||||
memcpy(bp, &zero, sizeof(u_int32_t));
|
||||
bp += sizeof(u_int32_t);
|
||||
} else {
|
||||
memcpy(bp, &name->size, sizeof(name->size));
|
||||
bp += sizeof(name->size);
|
||||
memcpy(bp, name->data, name->size);
|
||||
bp += name->size;
|
||||
}
|
||||
memcpy(bp, &mode, sizeof(mode));
|
||||
bp += sizeof(mode);
|
||||
DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size);
|
||||
ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags);
|
||||
if (txnid != NULL)
|
||||
txnid->last_lsn = *ret_lsnp;
|
||||
__os_free(logrec.data, logrec.size);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
int
|
||||
__crdel_fileopen_print(dbenv, dbtp, lsnp, notused2, notused3)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops notused2;
|
||||
void *notused3;
|
||||
{
|
||||
__crdel_fileopen_args *argp;
|
||||
u_int32_t i;
|
||||
u_int ch;
|
||||
int ret;
|
||||
|
||||
i = 0;
|
||||
ch = 0;
|
||||
notused2 = DB_TXN_ABORT;
|
||||
notused3 = NULL;
|
||||
|
||||
if ((ret = __crdel_fileopen_read(dbenv, dbtp->data, &argp)) != 0)
|
||||
return (ret);
|
||||
printf("[%lu][%lu]crdel_fileopen: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
|
||||
(u_long)lsnp->file,
|
||||
(u_long)lsnp->offset,
|
||||
(u_long)argp->type,
|
||||
(u_long)argp->txnid->txnid,
|
||||
(u_long)argp->prev_lsn.file,
|
||||
(u_long)argp->prev_lsn.offset);
|
||||
printf("\tname: ");
|
||||
for (i = 0; i < argp->name.size; i++) {
|
||||
ch = ((u_int8_t *)argp->name.data)[i];
|
||||
if (isprint(ch) || ch == 0xa)
|
||||
putchar(ch);
|
||||
else
|
||||
printf("%#x ", ch);
|
||||
}
|
||||
printf("\n");
|
||||
printf("\tmode: %o\n", argp->mode);
|
||||
printf("\n");
|
||||
__os_free(argp, 0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__crdel_fileopen_read(dbenv, recbuf, argpp)
|
||||
DB_ENV *dbenv;
|
||||
void *recbuf;
|
||||
__crdel_fileopen_args **argpp;
|
||||
{
|
||||
__crdel_fileopen_args *argp;
|
||||
u_int8_t *bp;
|
||||
int ret;
|
||||
|
||||
ret = __os_malloc(dbenv, sizeof(__crdel_fileopen_args) +
|
||||
sizeof(DB_TXN), NULL, &argp);
|
||||
if (ret != 0)
|
||||
return (ret);
|
||||
argp->txnid = (DB_TXN *)&argp[1];
|
||||
bp = recbuf;
|
||||
memcpy(&argp->type, bp, sizeof(argp->type));
|
||||
bp += sizeof(argp->type);
|
||||
memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid));
|
||||
bp += sizeof(argp->txnid->txnid);
|
||||
memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
|
||||
bp += sizeof(DB_LSN);
|
||||
memset(&argp->name, 0, sizeof(argp->name));
|
||||
memcpy(&argp->name.size, bp, sizeof(u_int32_t));
|
||||
bp += sizeof(u_int32_t);
|
||||
argp->name.data = bp;
|
||||
bp += argp->name.size;
|
||||
memcpy(&argp->mode, bp, sizeof(argp->mode));
|
||||
bp += sizeof(argp->mode);
|
||||
*argpp = argp;
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__crdel_metasub_log(dbenv, txnid, ret_lsnp, flags,
|
||||
fileid, pgno, page, lsn)
|
||||
DB_ENV *dbenv;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN *ret_lsnp;
|
||||
u_int32_t flags;
|
||||
int32_t fileid;
|
||||
db_pgno_t pgno;
|
||||
const DBT *page;
|
||||
DB_LSN * lsn;
|
||||
{
|
||||
DBT logrec;
|
||||
DB_LSN *lsnp, null_lsn;
|
||||
u_int32_t zero;
|
||||
u_int32_t rectype, txn_num;
|
||||
int ret;
|
||||
u_int8_t *bp;
|
||||
|
||||
rectype = DB_crdel_metasub;
|
||||
if (txnid != NULL &&
|
||||
TAILQ_FIRST(&txnid->kids) != NULL &&
|
||||
(ret = __txn_activekids(dbenv, rectype, txnid)) != 0)
|
||||
return (ret);
|
||||
txn_num = txnid == NULL ? 0 : txnid->txnid;
|
||||
if (txnid == NULL) {
|
||||
ZERO_LSN(null_lsn);
|
||||
lsnp = &null_lsn;
|
||||
} else
|
||||
lsnp = &txnid->last_lsn;
|
||||
logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
|
||||
+ sizeof(fileid)
|
||||
+ sizeof(pgno)
|
||||
+ sizeof(u_int32_t) + (page == NULL ? 0 : page->size)
|
||||
+ sizeof(*lsn);
|
||||
if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0)
|
||||
return (ret);
|
||||
|
||||
bp = logrec.data;
|
||||
memcpy(bp, &rectype, sizeof(rectype));
|
||||
bp += sizeof(rectype);
|
||||
memcpy(bp, &txn_num, sizeof(txn_num));
|
||||
bp += sizeof(txn_num);
|
||||
memcpy(bp, lsnp, sizeof(DB_LSN));
|
||||
bp += sizeof(DB_LSN);
|
||||
memcpy(bp, &fileid, sizeof(fileid));
|
||||
bp += sizeof(fileid);
|
||||
memcpy(bp, &pgno, sizeof(pgno));
|
||||
bp += sizeof(pgno);
|
||||
if (page == NULL) {
|
||||
zero = 0;
|
||||
memcpy(bp, &zero, sizeof(u_int32_t));
|
||||
bp += sizeof(u_int32_t);
|
||||
} else {
|
||||
memcpy(bp, &page->size, sizeof(page->size));
|
||||
bp += sizeof(page->size);
|
||||
memcpy(bp, page->data, page->size);
|
||||
bp += page->size;
|
||||
}
|
||||
if (lsn != NULL)
|
||||
memcpy(bp, lsn, sizeof(*lsn));
|
||||
else
|
||||
memset(bp, 0, sizeof(*lsn));
|
||||
bp += sizeof(*lsn);
|
||||
DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size);
|
||||
ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags);
|
||||
if (txnid != NULL)
|
||||
txnid->last_lsn = *ret_lsnp;
|
||||
__os_free(logrec.data, logrec.size);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
int
|
||||
__crdel_metasub_print(dbenv, dbtp, lsnp, notused2, notused3)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops notused2;
|
||||
void *notused3;
|
||||
{
|
||||
__crdel_metasub_args *argp;
|
||||
u_int32_t i;
|
||||
u_int ch;
|
||||
int ret;
|
||||
|
||||
i = 0;
|
||||
ch = 0;
|
||||
notused2 = DB_TXN_ABORT;
|
||||
notused3 = NULL;
|
||||
|
||||
if ((ret = __crdel_metasub_read(dbenv, dbtp->data, &argp)) != 0)
|
||||
return (ret);
|
||||
printf("[%lu][%lu]crdel_metasub: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
|
||||
(u_long)lsnp->file,
|
||||
(u_long)lsnp->offset,
|
||||
(u_long)argp->type,
|
||||
(u_long)argp->txnid->txnid,
|
||||
(u_long)argp->prev_lsn.file,
|
||||
(u_long)argp->prev_lsn.offset);
|
||||
printf("\tfileid: %ld\n", (long)argp->fileid);
|
||||
printf("\tpgno: %d\n", argp->pgno);
|
||||
printf("\tpage: ");
|
||||
for (i = 0; i < argp->page.size; i++) {
|
||||
ch = ((u_int8_t *)argp->page.data)[i];
|
||||
if (isprint(ch) || ch == 0xa)
|
||||
putchar(ch);
|
||||
else
|
||||
printf("%#x ", ch);
|
||||
}
|
||||
printf("\n");
|
||||
printf("\tlsn: [%lu][%lu]\n",
|
||||
(u_long)argp->lsn.file, (u_long)argp->lsn.offset);
|
||||
printf("\n");
|
||||
__os_free(argp, 0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__crdel_metasub_read(dbenv, recbuf, argpp)
|
||||
DB_ENV *dbenv;
|
||||
void *recbuf;
|
||||
__crdel_metasub_args **argpp;
|
||||
{
|
||||
__crdel_metasub_args *argp;
|
||||
u_int8_t *bp;
|
||||
int ret;
|
||||
|
||||
ret = __os_malloc(dbenv, sizeof(__crdel_metasub_args) +
|
||||
sizeof(DB_TXN), NULL, &argp);
|
||||
if (ret != 0)
|
||||
return (ret);
|
||||
argp->txnid = (DB_TXN *)&argp[1];
|
||||
bp = recbuf;
|
||||
memcpy(&argp->type, bp, sizeof(argp->type));
|
||||
bp += sizeof(argp->type);
|
||||
memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid));
|
||||
bp += sizeof(argp->txnid->txnid);
|
||||
memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
|
||||
bp += sizeof(DB_LSN);
|
||||
memcpy(&argp->fileid, bp, sizeof(argp->fileid));
|
||||
bp += sizeof(argp->fileid);
|
||||
memcpy(&argp->pgno, bp, sizeof(argp->pgno));
|
||||
bp += sizeof(argp->pgno);
|
||||
memset(&argp->page, 0, sizeof(argp->page));
|
||||
memcpy(&argp->page.size, bp, sizeof(u_int32_t));
|
||||
bp += sizeof(u_int32_t);
|
||||
argp->page.data = bp;
|
||||
bp += argp->page.size;
|
||||
memcpy(&argp->lsn, bp, sizeof(argp->lsn));
|
||||
bp += sizeof(argp->lsn);
|
||||
*argpp = argp;
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__crdel_metapage_log(dbenv, txnid, ret_lsnp, flags,
|
||||
fileid, name, pgno, page)
|
||||
DB_ENV *dbenv;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN *ret_lsnp;
|
||||
u_int32_t flags;
|
||||
int32_t fileid;
|
||||
const DBT *name;
|
||||
db_pgno_t pgno;
|
||||
const DBT *page;
|
||||
{
|
||||
DBT logrec;
|
||||
DB_LSN *lsnp, null_lsn;
|
||||
u_int32_t zero;
|
||||
u_int32_t rectype, txn_num;
|
||||
int ret;
|
||||
u_int8_t *bp;
|
||||
|
||||
rectype = DB_crdel_metapage;
|
||||
if (txnid != NULL &&
|
||||
TAILQ_FIRST(&txnid->kids) != NULL &&
|
||||
(ret = __txn_activekids(dbenv, rectype, txnid)) != 0)
|
||||
return (ret);
|
||||
txn_num = txnid == NULL ? 0 : txnid->txnid;
|
||||
if (txnid == NULL) {
|
||||
ZERO_LSN(null_lsn);
|
||||
lsnp = &null_lsn;
|
||||
} else
|
||||
lsnp = &txnid->last_lsn;
|
||||
logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
|
||||
+ sizeof(fileid)
|
||||
+ sizeof(u_int32_t) + (name == NULL ? 0 : name->size)
|
||||
+ sizeof(pgno)
|
||||
+ sizeof(u_int32_t) + (page == NULL ? 0 : page->size);
|
||||
if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0)
|
||||
return (ret);
|
||||
|
||||
bp = logrec.data;
|
||||
memcpy(bp, &rectype, sizeof(rectype));
|
||||
bp += sizeof(rectype);
|
||||
memcpy(bp, &txn_num, sizeof(txn_num));
|
||||
bp += sizeof(txn_num);
|
||||
memcpy(bp, lsnp, sizeof(DB_LSN));
|
||||
bp += sizeof(DB_LSN);
|
||||
memcpy(bp, &fileid, sizeof(fileid));
|
||||
bp += sizeof(fileid);
|
||||
if (name == NULL) {
|
||||
zero = 0;
|
||||
memcpy(bp, &zero, sizeof(u_int32_t));
|
||||
bp += sizeof(u_int32_t);
|
||||
} else {
|
||||
memcpy(bp, &name->size, sizeof(name->size));
|
||||
bp += sizeof(name->size);
|
||||
memcpy(bp, name->data, name->size);
|
||||
bp += name->size;
|
||||
}
|
||||
memcpy(bp, &pgno, sizeof(pgno));
|
||||
bp += sizeof(pgno);
|
||||
if (page == NULL) {
|
||||
zero = 0;
|
||||
memcpy(bp, &zero, sizeof(u_int32_t));
|
||||
bp += sizeof(u_int32_t);
|
||||
} else {
|
||||
memcpy(bp, &page->size, sizeof(page->size));
|
||||
bp += sizeof(page->size);
|
||||
memcpy(bp, page->data, page->size);
|
||||
bp += page->size;
|
||||
}
|
||||
DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size);
|
||||
ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags);
|
||||
if (txnid != NULL)
|
||||
txnid->last_lsn = *ret_lsnp;
|
||||
__os_free(logrec.data, logrec.size);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
int
|
||||
__crdel_metapage_print(dbenv, dbtp, lsnp, notused2, notused3)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops notused2;
|
||||
void *notused3;
|
||||
{
|
||||
__crdel_metapage_args *argp;
|
||||
u_int32_t i;
|
||||
u_int ch;
|
||||
int ret;
|
||||
|
||||
i = 0;
|
||||
ch = 0;
|
||||
notused2 = DB_TXN_ABORT;
|
||||
notused3 = NULL;
|
||||
|
||||
if ((ret = __crdel_metapage_read(dbenv, dbtp->data, &argp)) != 0)
|
||||
return (ret);
|
||||
printf("[%lu][%lu]crdel_metapage: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
|
||||
(u_long)lsnp->file,
|
||||
(u_long)lsnp->offset,
|
||||
(u_long)argp->type,
|
||||
(u_long)argp->txnid->txnid,
|
||||
(u_long)argp->prev_lsn.file,
|
||||
(u_long)argp->prev_lsn.offset);
|
||||
printf("\tfileid: %ld\n", (long)argp->fileid);
|
||||
printf("\tname: ");
|
||||
for (i = 0; i < argp->name.size; i++) {
|
||||
ch = ((u_int8_t *)argp->name.data)[i];
|
||||
if (isprint(ch) || ch == 0xa)
|
||||
putchar(ch);
|
||||
else
|
||||
printf("%#x ", ch);
|
||||
}
|
||||
printf("\n");
|
||||
printf("\tpgno: %d\n", argp->pgno);
|
||||
printf("\tpage: ");
|
||||
for (i = 0; i < argp->page.size; i++) {
|
||||
ch = ((u_int8_t *)argp->page.data)[i];
|
||||
if (isprint(ch) || ch == 0xa)
|
||||
putchar(ch);
|
||||
else
|
||||
printf("%#x ", ch);
|
||||
}
|
||||
printf("\n");
|
||||
printf("\n");
|
||||
__os_free(argp, 0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__crdel_metapage_read(dbenv, recbuf, argpp)
|
||||
DB_ENV *dbenv;
|
||||
void *recbuf;
|
||||
__crdel_metapage_args **argpp;
|
||||
{
|
||||
__crdel_metapage_args *argp;
|
||||
u_int8_t *bp;
|
||||
int ret;
|
||||
|
||||
ret = __os_malloc(dbenv, sizeof(__crdel_metapage_args) +
|
||||
sizeof(DB_TXN), NULL, &argp);
|
||||
if (ret != 0)
|
||||
return (ret);
|
||||
argp->txnid = (DB_TXN *)&argp[1];
|
||||
bp = recbuf;
|
||||
memcpy(&argp->type, bp, sizeof(argp->type));
|
||||
bp += sizeof(argp->type);
|
||||
memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid));
|
||||
bp += sizeof(argp->txnid->txnid);
|
||||
memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
|
||||
bp += sizeof(DB_LSN);
|
||||
memcpy(&argp->fileid, bp, sizeof(argp->fileid));
|
||||
bp += sizeof(argp->fileid);
|
||||
memset(&argp->name, 0, sizeof(argp->name));
|
||||
memcpy(&argp->name.size, bp, sizeof(u_int32_t));
|
||||
bp += sizeof(u_int32_t);
|
||||
argp->name.data = bp;
|
||||
bp += argp->name.size;
|
||||
memcpy(&argp->pgno, bp, sizeof(argp->pgno));
|
||||
bp += sizeof(argp->pgno);
|
||||
memset(&argp->page, 0, sizeof(argp->page));
|
||||
memcpy(&argp->page.size, bp, sizeof(u_int32_t));
|
||||
bp += sizeof(u_int32_t);
|
||||
argp->page.data = bp;
|
||||
bp += argp->page.size;
|
||||
*argpp = argp;
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__crdel_old_delete_print(dbenv, dbtp, lsnp, notused2, notused3)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops notused2;
|
||||
void *notused3;
|
||||
{
|
||||
__crdel_old_delete_args *argp;
|
||||
u_int32_t i;
|
||||
u_int ch;
|
||||
int ret;
|
||||
|
||||
i = 0;
|
||||
ch = 0;
|
||||
notused2 = DB_TXN_ABORT;
|
||||
notused3 = NULL;
|
||||
|
||||
if ((ret = __crdel_old_delete_read(dbenv, dbtp->data, &argp)) != 0)
|
||||
return (ret);
|
||||
printf("[%lu][%lu]crdel_old_delete: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
|
||||
(u_long)lsnp->file,
|
||||
(u_long)lsnp->offset,
|
||||
(u_long)argp->type,
|
||||
(u_long)argp->txnid->txnid,
|
||||
(u_long)argp->prev_lsn.file,
|
||||
(u_long)argp->prev_lsn.offset);
|
||||
printf("\tname: ");
|
||||
for (i = 0; i < argp->name.size; i++) {
|
||||
ch = ((u_int8_t *)argp->name.data)[i];
|
||||
if (isprint(ch) || ch == 0xa)
|
||||
putchar(ch);
|
||||
else
|
||||
printf("%#x ", ch);
|
||||
}
|
||||
printf("\n");
|
||||
printf("\n");
|
||||
__os_free(argp, 0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__crdel_old_delete_read(dbenv, recbuf, argpp)
|
||||
DB_ENV *dbenv;
|
||||
void *recbuf;
|
||||
__crdel_old_delete_args **argpp;
|
||||
{
|
||||
__crdel_old_delete_args *argp;
|
||||
u_int8_t *bp;
|
||||
int ret;
|
||||
|
||||
ret = __os_malloc(dbenv, sizeof(__crdel_old_delete_args) +
|
||||
sizeof(DB_TXN), NULL, &argp);
|
||||
if (ret != 0)
|
||||
return (ret);
|
||||
argp->txnid = (DB_TXN *)&argp[1];
|
||||
bp = recbuf;
|
||||
memcpy(&argp->type, bp, sizeof(argp->type));
|
||||
bp += sizeof(argp->type);
|
||||
memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid));
|
||||
bp += sizeof(argp->txnid->txnid);
|
||||
memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
|
||||
bp += sizeof(DB_LSN);
|
||||
memset(&argp->name, 0, sizeof(argp->name));
|
||||
memcpy(&argp->name.size, bp, sizeof(u_int32_t));
|
||||
bp += sizeof(u_int32_t);
|
||||
argp->name.data = bp;
|
||||
bp += argp->name.size;
|
||||
*argpp = argp;
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__crdel_rename_log(dbenv, txnid, ret_lsnp, flags,
|
||||
fileid, name, newname)
|
||||
DB_ENV *dbenv;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN *ret_lsnp;
|
||||
u_int32_t flags;
|
||||
int32_t fileid;
|
||||
const DBT *name;
|
||||
const DBT *newname;
|
||||
{
|
||||
DBT logrec;
|
||||
DB_LSN *lsnp, null_lsn;
|
||||
u_int32_t zero;
|
||||
u_int32_t rectype, txn_num;
|
||||
int ret;
|
||||
u_int8_t *bp;
|
||||
|
||||
rectype = DB_crdel_rename;
|
||||
if (txnid != NULL &&
|
||||
TAILQ_FIRST(&txnid->kids) != NULL &&
|
||||
(ret = __txn_activekids(dbenv, rectype, txnid)) != 0)
|
||||
return (ret);
|
||||
txn_num = txnid == NULL ? 0 : txnid->txnid;
|
||||
if (txnid == NULL) {
|
||||
ZERO_LSN(null_lsn);
|
||||
lsnp = &null_lsn;
|
||||
} else
|
||||
lsnp = &txnid->last_lsn;
|
||||
logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
|
||||
+ sizeof(fileid)
|
||||
+ sizeof(u_int32_t) + (name == NULL ? 0 : name->size)
|
||||
+ sizeof(u_int32_t) + (newname == NULL ? 0 : newname->size);
|
||||
if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0)
|
||||
return (ret);
|
||||
|
||||
bp = logrec.data;
|
||||
memcpy(bp, &rectype, sizeof(rectype));
|
||||
bp += sizeof(rectype);
|
||||
memcpy(bp, &txn_num, sizeof(txn_num));
|
||||
bp += sizeof(txn_num);
|
||||
memcpy(bp, lsnp, sizeof(DB_LSN));
|
||||
bp += sizeof(DB_LSN);
|
||||
memcpy(bp, &fileid, sizeof(fileid));
|
||||
bp += sizeof(fileid);
|
||||
if (name == NULL) {
|
||||
zero = 0;
|
||||
memcpy(bp, &zero, sizeof(u_int32_t));
|
||||
bp += sizeof(u_int32_t);
|
||||
} else {
|
||||
memcpy(bp, &name->size, sizeof(name->size));
|
||||
bp += sizeof(name->size);
|
||||
memcpy(bp, name->data, name->size);
|
||||
bp += name->size;
|
||||
}
|
||||
if (newname == NULL) {
|
||||
zero = 0;
|
||||
memcpy(bp, &zero, sizeof(u_int32_t));
|
||||
bp += sizeof(u_int32_t);
|
||||
} else {
|
||||
memcpy(bp, &newname->size, sizeof(newname->size));
|
||||
bp += sizeof(newname->size);
|
||||
memcpy(bp, newname->data, newname->size);
|
||||
bp += newname->size;
|
||||
}
|
||||
DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size);
|
||||
ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags);
|
||||
if (txnid != NULL)
|
||||
txnid->last_lsn = *ret_lsnp;
|
||||
__os_free(logrec.data, logrec.size);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
int
|
||||
__crdel_rename_print(dbenv, dbtp, lsnp, notused2, notused3)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops notused2;
|
||||
void *notused3;
|
||||
{
|
||||
__crdel_rename_args *argp;
|
||||
u_int32_t i;
|
||||
u_int ch;
|
||||
int ret;
|
||||
|
||||
i = 0;
|
||||
ch = 0;
|
||||
notused2 = DB_TXN_ABORT;
|
||||
notused3 = NULL;
|
||||
|
||||
if ((ret = __crdel_rename_read(dbenv, dbtp->data, &argp)) != 0)
|
||||
return (ret);
|
||||
printf("[%lu][%lu]crdel_rename: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
|
||||
(u_long)lsnp->file,
|
||||
(u_long)lsnp->offset,
|
||||
(u_long)argp->type,
|
||||
(u_long)argp->txnid->txnid,
|
||||
(u_long)argp->prev_lsn.file,
|
||||
(u_long)argp->prev_lsn.offset);
|
||||
printf("\tfileid: %ld\n", (long)argp->fileid);
|
||||
printf("\tname: ");
|
||||
for (i = 0; i < argp->name.size; i++) {
|
||||
ch = ((u_int8_t *)argp->name.data)[i];
|
||||
if (isprint(ch) || ch == 0xa)
|
||||
putchar(ch);
|
||||
else
|
||||
printf("%#x ", ch);
|
||||
}
|
||||
printf("\n");
|
||||
printf("\tnewname: ");
|
||||
for (i = 0; i < argp->newname.size; i++) {
|
||||
ch = ((u_int8_t *)argp->newname.data)[i];
|
||||
if (isprint(ch) || ch == 0xa)
|
||||
putchar(ch);
|
||||
else
|
||||
printf("%#x ", ch);
|
||||
}
|
||||
printf("\n");
|
||||
printf("\n");
|
||||
__os_free(argp, 0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__crdel_rename_read(dbenv, recbuf, argpp)
|
||||
DB_ENV *dbenv;
|
||||
void *recbuf;
|
||||
__crdel_rename_args **argpp;
|
||||
{
|
||||
__crdel_rename_args *argp;
|
||||
u_int8_t *bp;
|
||||
int ret;
|
||||
|
||||
ret = __os_malloc(dbenv, sizeof(__crdel_rename_args) +
|
||||
sizeof(DB_TXN), NULL, &argp);
|
||||
if (ret != 0)
|
||||
return (ret);
|
||||
argp->txnid = (DB_TXN *)&argp[1];
|
||||
bp = recbuf;
|
||||
memcpy(&argp->type, bp, sizeof(argp->type));
|
||||
bp += sizeof(argp->type);
|
||||
memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid));
|
||||
bp += sizeof(argp->txnid->txnid);
|
||||
memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
|
||||
bp += sizeof(DB_LSN);
|
||||
memcpy(&argp->fileid, bp, sizeof(argp->fileid));
|
||||
bp += sizeof(argp->fileid);
|
||||
memset(&argp->name, 0, sizeof(argp->name));
|
||||
memcpy(&argp->name.size, bp, sizeof(u_int32_t));
|
||||
bp += sizeof(u_int32_t);
|
||||
argp->name.data = bp;
|
||||
bp += argp->name.size;
|
||||
memset(&argp->newname, 0, sizeof(argp->newname));
|
||||
memcpy(&argp->newname.size, bp, sizeof(u_int32_t));
|
||||
bp += sizeof(u_int32_t);
|
||||
argp->newname.data = bp;
|
||||
bp += argp->newname.size;
|
||||
*argpp = argp;
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__crdel_delete_log(dbenv, txnid, ret_lsnp, flags,
|
||||
fileid, name)
|
||||
DB_ENV *dbenv;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN *ret_lsnp;
|
||||
u_int32_t flags;
|
||||
int32_t fileid;
|
||||
const DBT *name;
|
||||
{
|
||||
DBT logrec;
|
||||
DB_LSN *lsnp, null_lsn;
|
||||
u_int32_t zero;
|
||||
u_int32_t rectype, txn_num;
|
||||
int ret;
|
||||
u_int8_t *bp;
|
||||
|
||||
rectype = DB_crdel_delete;
|
||||
if (txnid != NULL &&
|
||||
TAILQ_FIRST(&txnid->kids) != NULL &&
|
||||
(ret = __txn_activekids(dbenv, rectype, txnid)) != 0)
|
||||
return (ret);
|
||||
txn_num = txnid == NULL ? 0 : txnid->txnid;
|
||||
if (txnid == NULL) {
|
||||
ZERO_LSN(null_lsn);
|
||||
lsnp = &null_lsn;
|
||||
} else
|
||||
lsnp = &txnid->last_lsn;
|
||||
logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
|
||||
+ sizeof(fileid)
|
||||
+ sizeof(u_int32_t) + (name == NULL ? 0 : name->size);
|
||||
if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0)
|
||||
return (ret);
|
||||
|
||||
bp = logrec.data;
|
||||
memcpy(bp, &rectype, sizeof(rectype));
|
||||
bp += sizeof(rectype);
|
||||
memcpy(bp, &txn_num, sizeof(txn_num));
|
||||
bp += sizeof(txn_num);
|
||||
memcpy(bp, lsnp, sizeof(DB_LSN));
|
||||
bp += sizeof(DB_LSN);
|
||||
memcpy(bp, &fileid, sizeof(fileid));
|
||||
bp += sizeof(fileid);
|
||||
if (name == NULL) {
|
||||
zero = 0;
|
||||
memcpy(bp, &zero, sizeof(u_int32_t));
|
||||
bp += sizeof(u_int32_t);
|
||||
} else {
|
||||
memcpy(bp, &name->size, sizeof(name->size));
|
||||
bp += sizeof(name->size);
|
||||
memcpy(bp, name->data, name->size);
|
||||
bp += name->size;
|
||||
}
|
||||
DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size);
|
||||
ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags);
|
||||
if (txnid != NULL)
|
||||
txnid->last_lsn = *ret_lsnp;
|
||||
__os_free(logrec.data, logrec.size);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
int
|
||||
__crdel_delete_print(dbenv, dbtp, lsnp, notused2, notused3)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops notused2;
|
||||
void *notused3;
|
||||
{
|
||||
__crdel_delete_args *argp;
|
||||
u_int32_t i;
|
||||
u_int ch;
|
||||
int ret;
|
||||
|
||||
i = 0;
|
||||
ch = 0;
|
||||
notused2 = DB_TXN_ABORT;
|
||||
notused3 = NULL;
|
||||
|
||||
if ((ret = __crdel_delete_read(dbenv, dbtp->data, &argp)) != 0)
|
||||
return (ret);
|
||||
printf("[%lu][%lu]crdel_delete: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
|
||||
(u_long)lsnp->file,
|
||||
(u_long)lsnp->offset,
|
||||
(u_long)argp->type,
|
||||
(u_long)argp->txnid->txnid,
|
||||
(u_long)argp->prev_lsn.file,
|
||||
(u_long)argp->prev_lsn.offset);
|
||||
printf("\tfileid: %ld\n", (long)argp->fileid);
|
||||
printf("\tname: ");
|
||||
for (i = 0; i < argp->name.size; i++) {
|
||||
ch = ((u_int8_t *)argp->name.data)[i];
|
||||
if (isprint(ch) || ch == 0xa)
|
||||
putchar(ch);
|
||||
else
|
||||
printf("%#x ", ch);
|
||||
}
|
||||
printf("\n");
|
||||
printf("\n");
|
||||
__os_free(argp, 0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__crdel_delete_read(dbenv, recbuf, argpp)
|
||||
DB_ENV *dbenv;
|
||||
void *recbuf;
|
||||
__crdel_delete_args **argpp;
|
||||
{
|
||||
__crdel_delete_args *argp;
|
||||
u_int8_t *bp;
|
||||
int ret;
|
||||
|
||||
ret = __os_malloc(dbenv, sizeof(__crdel_delete_args) +
|
||||
sizeof(DB_TXN), NULL, &argp);
|
||||
if (ret != 0)
|
||||
return (ret);
|
||||
argp->txnid = (DB_TXN *)&argp[1];
|
||||
bp = recbuf;
|
||||
memcpy(&argp->type, bp, sizeof(argp->type));
|
||||
bp += sizeof(argp->type);
|
||||
memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid));
|
||||
bp += sizeof(argp->txnid->txnid);
|
||||
memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
|
||||
bp += sizeof(DB_LSN);
|
||||
memcpy(&argp->fileid, bp, sizeof(argp->fileid));
|
||||
bp += sizeof(argp->fileid);
|
||||
memset(&argp->name, 0, sizeof(argp->name));
|
||||
memcpy(&argp->name.size, bp, sizeof(u_int32_t));
|
||||
bp += sizeof(u_int32_t);
|
||||
argp->name.data = bp;
|
||||
bp += argp->name.size;
|
||||
*argpp = argp;
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__crdel_init_print(dbenv)
|
||||
DB_ENV *dbenv;
|
||||
{
|
||||
int ret;
|
||||
|
||||
if ((ret = __db_add_recovery(dbenv,
|
||||
__crdel_fileopen_print, DB_crdel_fileopen)) != 0)
|
||||
return (ret);
|
||||
if ((ret = __db_add_recovery(dbenv,
|
||||
__crdel_metasub_print, DB_crdel_metasub)) != 0)
|
||||
return (ret);
|
||||
if ((ret = __db_add_recovery(dbenv,
|
||||
__crdel_metapage_print, DB_crdel_metapage)) != 0)
|
||||
return (ret);
|
||||
if ((ret = __db_add_recovery(dbenv,
|
||||
__crdel_old_delete_print, DB_crdel_old_delete)) != 0)
|
||||
return (ret);
|
||||
if ((ret = __db_add_recovery(dbenv,
|
||||
__crdel_rename_print, DB_crdel_rename)) != 0)
|
||||
return (ret);
|
||||
if ((ret = __db_add_recovery(dbenv,
|
||||
__crdel_delete_print, DB_crdel_delete)) != 0)
|
||||
return (ret);
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__crdel_init_recover(dbenv)
|
||||
DB_ENV *dbenv;
|
||||
{
|
||||
int ret;
|
||||
|
||||
if ((ret = __db_add_recovery(dbenv,
|
||||
__crdel_fileopen_recover, DB_crdel_fileopen)) != 0)
|
||||
return (ret);
|
||||
if ((ret = __db_add_recovery(dbenv,
|
||||
__crdel_metasub_recover, DB_crdel_metasub)) != 0)
|
||||
return (ret);
|
||||
if ((ret = __db_add_recovery(dbenv,
|
||||
__crdel_metapage_recover, DB_crdel_metapage)) != 0)
|
||||
return (ret);
|
||||
if ((ret = __db_add_recovery(dbenv,
|
||||
__deprecated_recover, DB_crdel_old_delete)) != 0)
|
||||
return (ret);
|
||||
if ((ret = __db_add_recovery(dbenv,
|
||||
__crdel_rename_recover, DB_crdel_rename)) != 0)
|
||||
return (ret);
|
||||
if ((ret = __db_add_recovery(dbenv,
|
||||
__crdel_delete_recover, DB_crdel_delete)) != 0)
|
||||
return (ret);
|
||||
return (0);
|
||||
}
|
||||
|
1270
bdb/db/db_auto.c
1270
bdb/db/db_auto.c
File diff suppressed because it is too large
Load diff
50
bdb/dist/build/chk.def
vendored
50
bdb/dist/build/chk.def
vendored
|
@ -1,50 +0,0 @@
|
|||
#!/bin/sh -
|
||||
#
|
||||
# $Id: chk.def,v 1.4 2000/12/12 18:20:59 bostic Exp $
|
||||
#
|
||||
# Check to make sure we haven't forgotten to add any interfaces
|
||||
# to the Win32 libdb.def file.
|
||||
|
||||
# Run from the top-level directory.
|
||||
[ -f db_config.h ] && cd ..
|
||||
|
||||
f=build_win32/libdb.def
|
||||
t1=/tmp/__1
|
||||
t2=/tmp/__2
|
||||
|
||||
sed '/; /d' $f |
|
||||
egrep @ |
|
||||
awk '{print $1}' |
|
||||
sed -e '/db_xa_switch/d' \
|
||||
-e '/^__/d' -e '/^;/d' |
|
||||
sort > ${t1}
|
||||
|
||||
egrep __P include/db.src |
|
||||
sed '/^[a-z]/!d' |
|
||||
awk '{print $2}' |
|
||||
sed 's/^\*//' |
|
||||
sed '/^__/d' | sort > ${t2}
|
||||
|
||||
if cmp -s ${t1} ${t2} ; then
|
||||
:
|
||||
else
|
||||
echo "<<< libdb.def"
|
||||
echo ">>> DB include files"
|
||||
diff ${t1} ${t2}
|
||||
fi
|
||||
|
||||
# Check to make sure we don't have any extras in the libdb.def file.
|
||||
sed '/; /d' $f |
|
||||
egrep @ |
|
||||
awk '{print $1}' |
|
||||
sed -e '/__db_global_values/d' > ${t1}
|
||||
|
||||
for i in `cat ${t1}`; do
|
||||
if egrep $i */*.c > /dev/null; then
|
||||
:
|
||||
else
|
||||
echo "$f: $i not found in DB sources"
|
||||
fi
|
||||
done
|
||||
|
||||
rm -f ${t1} ${t2}
|
55
bdb/dist/build/chk.define
vendored
55
bdb/dist/build/chk.define
vendored
|
@ -1,55 +0,0 @@
|
|||
#!/bin/sh -
|
||||
#
|
||||
# $Id: chk.define,v 1.8 2000/12/12 18:20:59 bostic Exp $
|
||||
#
|
||||
# Check to make sure that all #defines are actually used.
|
||||
|
||||
# Run from the top-level directory.
|
||||
[ -f db_config.h ] && cd ..
|
||||
|
||||
t1=/tmp/__1
|
||||
|
||||
egrep '^#define' include/*.h |
|
||||
sed -e '/db_185.h/d' -e '/xa.h/d' |
|
||||
awk '{print $2}' |
|
||||
sed -e '/^B_DELETE/d' \
|
||||
-e '/^B_MAX/d' \
|
||||
-e '/^CIRCLEQ/d' \
|
||||
-e '/^DB_RO_ACCESS/d' \
|
||||
-e '/^DEFINE_DB_CLASS/d' \
|
||||
-e '/^LIST/d' \
|
||||
-e '/^LOG_OP/d' \
|
||||
-e '/^MINFILL/d' \
|
||||
-e '/^MUTEX_FIELDS/d' \
|
||||
-e '/^NCACHED2X/d' \
|
||||
-e '/^NCACHED30/d' \
|
||||
-e '/^PAIR_MASK/d' \
|
||||
-e '/^POWER_OF_TWO/d' \
|
||||
-e '/^P_16_COPY/d' \
|
||||
-e '/^P_32_COPY/d' \
|
||||
-e '/^P_32_SWAP/d' \
|
||||
-e '/^SH_CIRCLEQ/d' \
|
||||
-e '/^SH_LIST/d' \
|
||||
-e '/^SH_TAILQ/d' \
|
||||
-e '/^TAILQ/d' \
|
||||
-e '/UNUSED/d' \
|
||||
-e '/^WRAPPED_CLASS/d' \
|
||||
-e '/^XA_$/d' \
|
||||
-e '/^_DB_SERVER_H_RPCGEN/d' \
|
||||
-e '/_AUTO_H$/d' \
|
||||
-e '/_H_$/d' \
|
||||
-e '/ext_h_/d' \
|
||||
-e '/^i_/d' \
|
||||
-e 's/(.*//' | sort > ${t1}
|
||||
|
||||
for i in `cat ${t1}`; do
|
||||
if egrep -w $i */*.c */*.cpp > /dev/null; then
|
||||
:;
|
||||
else
|
||||
f=`egrep -l $i include/*.h |
|
||||
sed 's;include/;;' | tr -s "[:space:]" " "`
|
||||
echo "$i: $f"
|
||||
fi
|
||||
done | sort +1
|
||||
|
||||
rm -f ${t1}
|
19
bdb/dist/build/chk.offt
vendored
19
bdb/dist/build/chk.offt
vendored
|
@ -1,19 +0,0 @@
|
|||
#!/bin/sh -
|
||||
#
|
||||
# $Id: chk.offt,v 1.3 2000/12/12 18:20:59 bostic Exp $
|
||||
#
|
||||
# Make sure that no off_t's have snuck into the release.
|
||||
|
||||
# Run from the top-level directory.
|
||||
[ -f db_config.h ] && cd ..
|
||||
|
||||
egrep -w off_t */*.[ch] |
|
||||
sed -e "/#undef off_t/d" \
|
||||
-e "/mp_fopen.c:.*can't use off_t's here/d" \
|
||||
-e "/mp_fopen.c:.*size or type off_t's or/d" \
|
||||
-e "/mp_fopen.c:.*where an off_t is 32-bits/d" \
|
||||
-e "/os_map.c:.*(off_t)0))/d" \
|
||||
-e "/os_rw.c:.*(off_t)db_iop->pgno/d" \
|
||||
-e "/os_seek.c:.*off_t offset;/d" \
|
||||
-e "/os_seek.c:.*offset = /d" \
|
||||
-e "/test_vxworks\/vx_mutex.c:/d"
|
29
bdb/dist/build/chk.srcfiles
vendored
29
bdb/dist/build/chk.srcfiles
vendored
|
@ -1,29 +0,0 @@
|
|||
#!/bin/sh -
|
||||
#
|
||||
# $Id: chk.srcfiles,v 1.3 2000/12/12 18:20:59 bostic Exp $
|
||||
#
|
||||
# Check to make sure we haven't forgotten to add any files to the list
|
||||
# of source files Win32 uses to build its dsp files.
|
||||
|
||||
# Run from the top-level directory.
|
||||
[ -f db_config.h ] && cd ..
|
||||
|
||||
f=dist/srcfiles.in
|
||||
t1=/tmp/__1
|
||||
t2=/tmp/__2
|
||||
|
||||
sed -e '/^[ #]/d' \
|
||||
-e '/^$/d' < $f |
|
||||
awk '{print $1}' > ${t1}
|
||||
find . -type f |
|
||||
sed -e 's/^\.\///' |
|
||||
egrep '\.c$|\.cpp$|\.def$|\.rc$' |
|
||||
sed -e '/dist\/build\/chk.def/d' \
|
||||
-e '/perl.DB_File\/version.c/d' |
|
||||
sort > ${t2}
|
||||
|
||||
cmp ${t1} ${t2} > /dev/null ||
|
||||
(echo "<<< srcfiles.in >>> existing files" && \
|
||||
diff ${t1} ${t2} | tee /tmp/_f)
|
||||
|
||||
rm -f ${t1} ${t2}
|
39
bdb/dist/build/chk.tags
vendored
39
bdb/dist/build/chk.tags
vendored
|
@ -1,39 +0,0 @@
|
|||
#!/bin/sh -
|
||||
#
|
||||
# $Id: chk.tags,v 1.5 2000/12/22 15:35:32 bostic Exp $
|
||||
#
|
||||
# Check to make sure we don't need any more symbolic links to tags files.
|
||||
|
||||
# Run from the top-level directory.
|
||||
[ -f db_config.h ] && cd ..
|
||||
|
||||
t1=/tmp/__1
|
||||
t2=/tmp/__2
|
||||
|
||||
(ls -F | egrep / | sort |
|
||||
sed -e 's/\///' \
|
||||
-e '/^CVS$/d' \
|
||||
-e '/^build_vxworks$/d' \
|
||||
-e '/^build_win32$/d' \
|
||||
-e '/^docs$/d' \
|
||||
-e '/^docs.text$/d' \
|
||||
-e '/^docs_src$/d' \
|
||||
-e '/^docs_text$/d' \
|
||||
-e '/^java$/d' \
|
||||
-e '/^perl.BerkeleyDB$/d' \
|
||||
-e '/^perl.DB_File$/d' \
|
||||
-e '/^test$/d' \
|
||||
-e '/^test_purify$/d' \
|
||||
-e '/^test_thread$/d' \
|
||||
-e '/^test_vxworks$/d') > ${t1}
|
||||
|
||||
(ls */tags | sed 's/\/tags$//' | sort) > ${t2}
|
||||
if diff ${t1} ${t2} > /dev/null; then
|
||||
:
|
||||
else
|
||||
echo "<<< source tree"
|
||||
echo ">>> tags files"
|
||||
diff ${t1} ${t2}
|
||||
fi
|
||||
|
||||
rm -f ${t1} ${t2}
|
1289
bdb/dist/config.guess
vendored
1289
bdb/dist/config.guess
vendored
File diff suppressed because it is too large
Load diff
231
bdb/dist/config.hin
vendored
231
bdb/dist/config.hin
vendored
|
@ -1,231 +0,0 @@
|
|||
/* config.hin. Generated automatically from configure.in by autoheader. */
|
||||
|
||||
/* Define to empty if the keyword does not work. */
|
||||
#undef const
|
||||
|
||||
/* Define if your struct stat has st_blksize. */
|
||||
#undef HAVE_ST_BLKSIZE
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef mode_t
|
||||
|
||||
/* Define to `long' if <sys/types.h> doesn't define. */
|
||||
#undef off_t
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef pid_t
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> doesn't define. */
|
||||
#undef size_t
|
||||
|
||||
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
|
||||
#undef STAT_MACROS_BROKEN
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#undef TIME_WITH_SYS_TIME
|
||||
|
||||
/* Define if your processor stores words with the most significant
|
||||
byte first (like Motorola and SPARC, unlike Intel and VAX). */
|
||||
#undef WORDS_BIGENDIAN
|
||||
|
||||
/* Define if you are building a version for running the test suite. */
|
||||
#undef CONFIG_TEST
|
||||
|
||||
/* Define if you want a debugging version. */
|
||||
#undef DEBUG
|
||||
|
||||
/* Define if you want a version that logs read operations. */
|
||||
#undef DEBUG_ROP
|
||||
|
||||
/* Define if you want a version that logs write operations. */
|
||||
#undef DEBUG_WOP
|
||||
|
||||
/* Define if you want a version with run-time diagnostic checking. */
|
||||
#undef DIAGNOSTIC
|
||||
|
||||
/* Define if you want to mask harmless unitialized memory read/writes. */
|
||||
#undef UMRW
|
||||
|
||||
/* Define if fcntl/F_SETFD denies child access to file descriptors. */
|
||||
#undef HAVE_FCNTL_F_SETFD
|
||||
|
||||
/* Define if building big-file environment (e.g., AIX, HP/UX, Solaris). */
|
||||
#undef HAVE_FILE_OFFSET_BITS
|
||||
|
||||
/* Mutex possibilities. */
|
||||
#undef HAVE_MUTEX_68K_GCC_ASSEMBLY
|
||||
#undef HAVE_MUTEX_AIX_CHECK_LOCK
|
||||
#undef HAVE_MUTEX_ALPHA_GCC_ASSEMBLY
|
||||
#undef HAVE_MUTEX_HPPA_GCC_ASSEMBLY
|
||||
#undef HAVE_MUTEX_HPPA_MSEM_INIT
|
||||
#undef HAVE_MUTEX_IA64_GCC_ASSEMBLY
|
||||
#undef HAVE_MUTEX_MACOS
|
||||
#undef HAVE_MUTEX_MSEM_INIT
|
||||
#undef HAVE_MUTEX_PPC_GCC_ASSEMBLY
|
||||
#undef HAVE_MUTEX_PTHREADS
|
||||
#undef HAVE_MUTEX_RELIANTUNIX_INITSPIN
|
||||
#undef HAVE_MUTEX_SCO_X86_CC_ASSEMBLY
|
||||
#undef HAVE_MUTEX_SEMA_INIT
|
||||
#undef HAVE_MUTEX_SGI_INIT_LOCK
|
||||
#undef HAVE_MUTEX_SOLARIS_LOCK_TRY
|
||||
#undef HAVE_MUTEX_SOLARIS_LWP
|
||||
#undef HAVE_MUTEX_SPARC_GCC_ASSEMBLY
|
||||
#undef HAVE_MUTEX_THREADS
|
||||
#undef HAVE_MUTEX_UI_THREADS
|
||||
#undef HAVE_MUTEX_UTS_CC_ASSEMBLY
|
||||
#undef HAVE_MUTEX_VMS
|
||||
#undef HAVE_MUTEX_VXWORKS
|
||||
#undef HAVE_MUTEX_WIN16
|
||||
#undef HAVE_MUTEX_WIN32
|
||||
#undef HAVE_MUTEX_X86_GCC_ASSEMBLY
|
||||
|
||||
/* Define if building on QNX. */
|
||||
#undef HAVE_QNX
|
||||
|
||||
/* Define if building RPC client/server. */
|
||||
#undef HAVE_RPC
|
||||
|
||||
/* Define if your sprintf returns a pointer, not a length. */
|
||||
#undef SPRINTF_RET_CHARPNT
|
||||
|
||||
/* Define if you have the getcwd function. */
|
||||
#undef HAVE_GETCWD
|
||||
|
||||
/* Define if you have the getopt function. */
|
||||
#undef HAVE_GETOPT
|
||||
|
||||
/* Define if you have the getuid function. */
|
||||
#undef HAVE_GETUID
|
||||
|
||||
/* Define if you have the memcmp function. */
|
||||
#undef HAVE_MEMCMP
|
||||
|
||||
/* Define if you have the memcpy function. */
|
||||
#undef HAVE_MEMCPY
|
||||
|
||||
/* Define if you have the memmove function. */
|
||||
#undef HAVE_MEMMOVE
|
||||
|
||||
/* Define if you have the mlock function. */
|
||||
#undef HAVE_MLOCK
|
||||
|
||||
/* Define if you have the mmap function. */
|
||||
#undef HAVE_MMAP
|
||||
|
||||
/* Define if you have the munlock function. */
|
||||
#undef HAVE_MUNLOCK
|
||||
|
||||
/* Define if you have the munmap function. */
|
||||
#undef HAVE_MUNMAP
|
||||
|
||||
/* Define if you have the pread function. */
|
||||
#undef HAVE_PREAD
|
||||
|
||||
/* Define if you have the pstat_getdynamic function. */
|
||||
#undef HAVE_PSTAT_GETDYNAMIC
|
||||
|
||||
/* Define if you have the pwrite function. */
|
||||
#undef HAVE_PWRITE
|
||||
|
||||
/* Define if you have the qsort function. */
|
||||
#undef HAVE_QSORT
|
||||
|
||||
/* Define if you have the raise function. */
|
||||
#undef HAVE_RAISE
|
||||
|
||||
/* Define if you have the sched_yield function. */
|
||||
#undef HAVE_SCHED_YIELD
|
||||
|
||||
/* Define if you have the select function. */
|
||||
#undef HAVE_SELECT
|
||||
|
||||
/* Define if you have the shmget function. */
|
||||
#undef HAVE_SHMGET
|
||||
|
||||
/* Define if you have the snprintf function. */
|
||||
#undef HAVE_SNPRINTF
|
||||
|
||||
/* Define if you have the strcasecmp function. */
|
||||
#undef HAVE_STRCASECMP
|
||||
|
||||
/* Define if you have the strerror function. */
|
||||
#undef HAVE_STRERROR
|
||||
|
||||
/* Define if you have the strtoul function. */
|
||||
#undef HAVE_STRTOUL
|
||||
|
||||
/* Define if you have the sysconf function. */
|
||||
#undef HAVE_SYSCONF
|
||||
|
||||
/* Define if you have the vsnprintf function. */
|
||||
#undef HAVE_VSNPRINTF
|
||||
|
||||
/* Define if you have the yield function. */
|
||||
#undef HAVE_YIELD
|
||||
|
||||
/* Define if you have the <dirent.h> header file. */
|
||||
#undef HAVE_DIRENT_H
|
||||
|
||||
/* Define if you have the <ndir.h> header file. */
|
||||
#undef HAVE_NDIR_H
|
||||
|
||||
/* Define if you have the <sys/dir.h> header file. */
|
||||
#undef HAVE_SYS_DIR_H
|
||||
|
||||
/* Define if you have the <sys/ndir.h> header file. */
|
||||
#undef HAVE_SYS_NDIR_H
|
||||
|
||||
/* Define if you have the <sys/select.h> header file. */
|
||||
#undef HAVE_SYS_SELECT_H
|
||||
|
||||
/* Define if you have the <sys/time.h> header file. */
|
||||
#undef HAVE_SYS_TIME_H
|
||||
|
||||
/* Define if you have the nsl library (-lnsl). */
|
||||
#undef HAVE_LIBNSL
|
||||
|
||||
/*
|
||||
* Big-file configuration.
|
||||
*/
|
||||
#ifdef HAVE_FILE_OFFSET_BITS
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Don't step on the namespace. Other libraries may have their own
|
||||
* implementations of these functions, we don't want to use their
|
||||
* implementations or force them to use ours based on the load order.
|
||||
*/
|
||||
#ifndef HAVE_GETCWD
|
||||
#define getcwd __db_Cgetcwd
|
||||
#endif
|
||||
#ifndef HAVE_GETOPT
|
||||
#define getopt __db_Cgetopt
|
||||
#endif
|
||||
#ifndef HAVE_MEMCMP
|
||||
#define memcmp __db_Cmemcmp
|
||||
#endif
|
||||
#ifndef HAVE_MEMCPY
|
||||
#define memcpy __db_Cmemcpy
|
||||
#endif
|
||||
#ifndef HAVE_MEMMOVE
|
||||
#define memmove __db_Cmemmove
|
||||
#endif
|
||||
#ifndef HAVE_RAISE
|
||||
#define raise __db_Craise
|
||||
#endif
|
||||
#ifndef HAVE_SNPRINTF
|
||||
#define snprintf __db_Csnprintf
|
||||
#endif
|
||||
#ifndef HAVE_STRCASECMP
|
||||
#define strcasecmp __db_Cstrcasecmp
|
||||
#endif
|
||||
#ifndef HAVE_STRERROR
|
||||
#define strerror __db_Cstrerror
|
||||
#endif
|
||||
#ifndef HAVE_VSNPRINTF
|
||||
#define vsnprintf __db_Cvsnprintf
|
||||
#endif
|
1328
bdb/dist/config.sub
vendored
1328
bdb/dist/config.sub
vendored
File diff suppressed because it is too large
Load diff
251
bdb/dist/install-sh
vendored
251
bdb/dist/install-sh
vendored
|
@ -1,251 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# install - install a program, script, or datafile
|
||||
# This comes from X11R5 (mit/util/scripts/install.sh).
|
||||
#
|
||||
# Copyright 1991 by the Massachusetts Institute of Technology
|
||||
#
|
||||
# Permission to use, copy, modify, distribute, and sell this software and its
|
||||
# documentation for any purpose is hereby granted without fee, provided that
|
||||
# the above copyright notice appear in all copies and that both that
|
||||
# copyright notice and this permission notice appear in supporting
|
||||
# documentation, and that the name of M.I.T. not be used in advertising or
|
||||
# publicity pertaining to distribution of the software without specific,
|
||||
# written prior permission. M.I.T. makes no representations about the
|
||||
# suitability of this software for any purpose. It is provided "as is"
|
||||
# without express or implied warranty.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch. It can only install one file at a time, a restriction
|
||||
# shared with many OS's install programs.
|
||||
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit="${DOITPROG-}"
|
||||
|
||||
|
||||
# put in absolute paths if you don't have them in your path; or use env. vars.
|
||||
|
||||
mvprog="${MVPROG-mv}"
|
||||
cpprog="${CPPROG-cp}"
|
||||
chmodprog="${CHMODPROG-chmod}"
|
||||
chownprog="${CHOWNPROG-chown}"
|
||||
chgrpprog="${CHGRPPROG-chgrp}"
|
||||
stripprog="${STRIPPROG-strip}"
|
||||
rmprog="${RMPROG-rm}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
|
||||
transformbasename=""
|
||||
transform_arg=""
|
||||
instcmd="$mvprog"
|
||||
chmodcmd="$chmodprog 0755"
|
||||
chowncmd=""
|
||||
chgrpcmd=""
|
||||
stripcmd=""
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=""
|
||||
dst=""
|
||||
dir_arg=""
|
||||
|
||||
while [ x"$1" != x ]; do
|
||||
case $1 in
|
||||
-c) instcmd="$cpprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-d) dir_arg=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-m) chmodcmd="$chmodprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-s) stripcmd="$stripprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
*) if [ x"$src" = x ]
|
||||
then
|
||||
src=$1
|
||||
else
|
||||
# this colon is to work around a 386BSD /bin/sh bug
|
||||
:
|
||||
dst=$1
|
||||
fi
|
||||
shift
|
||||
continue;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ x"$src" = x ]
|
||||
then
|
||||
echo "install: no input file specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]; then
|
||||
dst=$src
|
||||
src=""
|
||||
|
||||
if [ -d $dst ]; then
|
||||
instcmd=:
|
||||
chmodcmd=""
|
||||
else
|
||||
instcmd=$mkdirprog
|
||||
fi
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
|
||||
if [ -f $src -o -d $src ]
|
||||
then
|
||||
true
|
||||
else
|
||||
echo "install: $src does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ x"$dst" = x ]
|
||||
then
|
||||
echo "install: no destination specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# If destination is a directory, append the input filename; if your system
|
||||
# does not like double slashes in filenames, you may need to add some logic
|
||||
|
||||
if [ -d $dst ]
|
||||
then
|
||||
dst="$dst"/`basename $src`
|
||||
else
|
||||
true
|
||||
fi
|
||||
fi
|
||||
|
||||
## this sed command emulates the dirname command
|
||||
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||
|
||||
# Make sure that the destination directory exists.
|
||||
# this part is taken from Noah Friedman's mkinstalldirs script
|
||||
|
||||
# Skip lots of stat calls in the usual case.
|
||||
if [ ! -d "$dstdir" ]; then
|
||||
defaultIFS='
|
||||
'
|
||||
IFS="${IFS-${defaultIFS}}"
|
||||
|
||||
oIFS="${IFS}"
|
||||
# Some sh's can't handle IFS=/ for some reason.
|
||||
IFS='%'
|
||||
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||
IFS="${oIFS}"
|
||||
|
||||
pathcomp=''
|
||||
|
||||
while [ $# -ne 0 ] ; do
|
||||
pathcomp="${pathcomp}${1}"
|
||||
shift
|
||||
|
||||
if [ ! -d "${pathcomp}" ] ;
|
||||
then
|
||||
$mkdirprog "${pathcomp}"
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
pathcomp="${pathcomp}/"
|
||||
done
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]
|
||||
then
|
||||
$doit $instcmd $dst &&
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
|
||||
else
|
||||
|
||||
# If we're going to rename the final executable, determine the name now.
|
||||
|
||||
if [ x"$transformarg" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
dstfile=`basename $dst $transformbasename |
|
||||
sed $transformarg`$transformbasename
|
||||
fi
|
||||
|
||||
# don't allow the sed command to completely eliminate the filename
|
||||
|
||||
if [ x"$dstfile" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# Make a temp file name in the proper directory.
|
||||
|
||||
dsttmp=$dstdir/#inst.$$#
|
||||
|
||||
# Move or copy the file name to the temp name
|
||||
|
||||
$doit $instcmd $src $dsttmp &&
|
||||
|
||||
trap "rm -f ${dsttmp}" 0 &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits
|
||||
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $instcmd $src $dsttmp" command.
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
|
||||
$doit $rmcmd -f $dstdir/$dstfile &&
|
||||
$doit $mvcmd $dsttmp $dstdir/$dstfile
|
||||
|
||||
fi &&
|
||||
|
||||
|
||||
exit 0
|
943
bdb/dist/template/rec_btree
vendored
943
bdb/dist/template/rec_btree
vendored
|
@ -1,943 +0,0 @@
|
|||
#include "db_config.h"
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#include "db_int.h"
|
||||
#include "db_page.h"
|
||||
#include "bam.h"
|
||||
#include "log.h"
|
||||
|
||||
/*
|
||||
* __bam_pg_alloc_recover --
|
||||
* Recovery function for pg_alloc.
|
||||
*
|
||||
* PUBLIC: int __bam_pg_alloc_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__bam_pg_alloc_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__bam_pg_alloc_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__bam_pg_alloc_print);
|
||||
REC_INTRO(__bam_pg_alloc_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __bam_pg_alloc1_recover --
|
||||
* Recovery function for pg_alloc1.
|
||||
*
|
||||
* PUBLIC: int __bam_pg_alloc1_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__bam_pg_alloc1_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__bam_pg_alloc1_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__bam_pg_alloc1_print);
|
||||
REC_INTRO(__bam_pg_alloc1_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __bam_pg_free_recover --
|
||||
* Recovery function for pg_free.
|
||||
*
|
||||
* PUBLIC: int __bam_pg_free_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__bam_pg_free_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__bam_pg_free_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__bam_pg_free_print);
|
||||
REC_INTRO(__bam_pg_free_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __bam_pg_free1_recover --
|
||||
* Recovery function for pg_free1.
|
||||
*
|
||||
* PUBLIC: int __bam_pg_free1_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__bam_pg_free1_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__bam_pg_free1_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__bam_pg_free1_print);
|
||||
REC_INTRO(__bam_pg_free1_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __bam_split1_recover --
|
||||
* Recovery function for split1.
|
||||
*
|
||||
* PUBLIC: int __bam_split1_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__bam_split1_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__bam_split1_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__bam_split1_print);
|
||||
REC_INTRO(__bam_split1_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __bam_split_recover --
|
||||
* Recovery function for split.
|
||||
*
|
||||
* PUBLIC: int __bam_split_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__bam_split_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__bam_split_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__bam_split_print);
|
||||
REC_INTRO(__bam_split_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __bam_rsplit1_recover --
|
||||
* Recovery function for rsplit1.
|
||||
*
|
||||
* PUBLIC: int __bam_rsplit1_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__bam_rsplit1_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__bam_rsplit1_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__bam_rsplit1_print);
|
||||
REC_INTRO(__bam_rsplit1_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __bam_rsplit_recover --
|
||||
* Recovery function for rsplit.
|
||||
*
|
||||
* PUBLIC: int __bam_rsplit_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__bam_rsplit_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__bam_rsplit_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__bam_rsplit_print);
|
||||
REC_INTRO(__bam_rsplit_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __bam_adj_recover --
|
||||
* Recovery function for adj.
|
||||
*
|
||||
* PUBLIC: int __bam_adj_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__bam_adj_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__bam_adj_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__bam_adj_print);
|
||||
REC_INTRO(__bam_adj_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __bam_cadjust_recover --
|
||||
* Recovery function for cadjust.
|
||||
*
|
||||
* PUBLIC: int __bam_cadjust_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__bam_cadjust_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__bam_cadjust_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__bam_cadjust_print);
|
||||
REC_INTRO(__bam_cadjust_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __bam_cdel_recover --
|
||||
* Recovery function for cdel.
|
||||
*
|
||||
* PUBLIC: int __bam_cdel_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__bam_cdel_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__bam_cdel_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__bam_cdel_print);
|
||||
REC_INTRO(__bam_cdel_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __bam_repl_recover --
|
||||
* Recovery function for repl.
|
||||
*
|
||||
* PUBLIC: int __bam_repl_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__bam_repl_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__bam_repl_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__bam_repl_print);
|
||||
REC_INTRO(__bam_repl_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __bam_root_recover --
|
||||
* Recovery function for root.
|
||||
*
|
||||
* PUBLIC: int __bam_root_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__bam_root_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__bam_root_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__bam_root_print);
|
||||
REC_INTRO(__bam_root_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __bam_curadj_recover --
|
||||
* Recovery function for curadj.
|
||||
*
|
||||
* PUBLIC: int __bam_curadj_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__bam_curadj_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__bam_curadj_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__bam_curadj_print);
|
||||
REC_INTRO(__bam_curadj_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __bam_rcuradj_recover --
|
||||
* Recovery function for rcuradj.
|
||||
*
|
||||
* PUBLIC: int __bam_rcuradj_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__bam_rcuradj_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__bam_rcuradj_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__bam_rcuradj_print);
|
||||
REC_INTRO(__bam_rcuradj_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
385
bdb/dist/template/rec_crdel
vendored
385
bdb/dist/template/rec_crdel
vendored
|
@ -1,385 +0,0 @@
|
|||
#include "db_config.h"
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#include "db_int.h"
|
||||
#include "db_page.h"
|
||||
#include "crdel.h"
|
||||
#include "log.h"
|
||||
|
||||
/*
|
||||
* __crdel_fileopen_recover --
|
||||
* Recovery function for fileopen.
|
||||
*
|
||||
* PUBLIC: int __crdel_fileopen_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__crdel_fileopen_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__crdel_fileopen_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__crdel_fileopen_print);
|
||||
REC_INTRO(__crdel_fileopen_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __crdel_metasub_recover --
|
||||
* Recovery function for metasub.
|
||||
*
|
||||
* PUBLIC: int __crdel_metasub_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__crdel_metasub_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__crdel_metasub_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__crdel_metasub_print);
|
||||
REC_INTRO(__crdel_metasub_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __crdel_metapage_recover --
|
||||
* Recovery function for metapage.
|
||||
*
|
||||
* PUBLIC: int __crdel_metapage_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__crdel_metapage_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__crdel_metapage_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__crdel_metapage_print);
|
||||
REC_INTRO(__crdel_metapage_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __crdel_old_delete_recover --
|
||||
* Recovery function for old_delete.
|
||||
*
|
||||
* PUBLIC: int __crdel_old_delete_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__crdel_old_delete_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__crdel_old_delete_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__crdel_old_delete_print);
|
||||
REC_INTRO(__crdel_old_delete_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __crdel_rename_recover --
|
||||
* Recovery function for rename.
|
||||
*
|
||||
* PUBLIC: int __crdel_rename_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__crdel_rename_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__crdel_rename_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__crdel_rename_print);
|
||||
REC_INTRO(__crdel_rename_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __crdel_delete_recover --
|
||||
* Recovery function for delete.
|
||||
*
|
||||
* PUBLIC: int __crdel_delete_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__crdel_delete_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__crdel_delete_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__crdel_delete_print);
|
||||
REC_INTRO(__crdel_delete_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
509
bdb/dist/template/rec_db
vendored
509
bdb/dist/template/rec_db
vendored
|
@ -1,509 +0,0 @@
|
|||
#include "db_config.h"
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#include "db_int.h"
|
||||
#include "db_page.h"
|
||||
#include "db.h"
|
||||
#include "log.h"
|
||||
|
||||
/*
|
||||
* __db_addrem_recover --
|
||||
* Recovery function for addrem.
|
||||
*
|
||||
* PUBLIC: int __db_addrem_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__db_addrem_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__db_addrem_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__db_addrem_print);
|
||||
REC_INTRO(__db_addrem_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __db_split_recover --
|
||||
* Recovery function for split.
|
||||
*
|
||||
* PUBLIC: int __db_split_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__db_split_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__db_split_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__db_split_print);
|
||||
REC_INTRO(__db_split_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __db_big_recover --
|
||||
* Recovery function for big.
|
||||
*
|
||||
* PUBLIC: int __db_big_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__db_big_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__db_big_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__db_big_print);
|
||||
REC_INTRO(__db_big_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __db_ovref_recover --
|
||||
* Recovery function for ovref.
|
||||
*
|
||||
* PUBLIC: int __db_ovref_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__db_ovref_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__db_ovref_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__db_ovref_print);
|
||||
REC_INTRO(__db_ovref_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __db_relink_recover --
|
||||
* Recovery function for relink.
|
||||
*
|
||||
* PUBLIC: int __db_relink_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__db_relink_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__db_relink_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__db_relink_print);
|
||||
REC_INTRO(__db_relink_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __db_addpage_recover --
|
||||
* Recovery function for addpage.
|
||||
*
|
||||
* PUBLIC: int __db_addpage_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__db_addpage_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__db_addpage_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__db_addpage_print);
|
||||
REC_INTRO(__db_addpage_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __db_debug_recover --
|
||||
* Recovery function for debug.
|
||||
*
|
||||
* PUBLIC: int __db_debug_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__db_debug_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__db_debug_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__db_debug_print);
|
||||
REC_INTRO(__db_debug_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __db_noop_recover --
|
||||
* Recovery function for noop.
|
||||
*
|
||||
* PUBLIC: int __db_noop_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__db_noop_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__db_noop_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__db_noop_print);
|
||||
REC_INTRO(__db_noop_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
881
bdb/dist/template/rec_hash
vendored
881
bdb/dist/template/rec_hash
vendored
|
@ -1,881 +0,0 @@
|
|||
#include "db_config.h"
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#include "db_int.h"
|
||||
#include "db_page.h"
|
||||
#include "ham.h"
|
||||
#include "log.h"
|
||||
|
||||
/*
|
||||
* __ham_insdel_recover --
|
||||
* Recovery function for insdel.
|
||||
*
|
||||
* PUBLIC: int __ham_insdel_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__ham_insdel_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__ham_insdel_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__ham_insdel_print);
|
||||
REC_INTRO(__ham_insdel_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __ham_newpage_recover --
|
||||
* Recovery function for newpage.
|
||||
*
|
||||
* PUBLIC: int __ham_newpage_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__ham_newpage_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__ham_newpage_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__ham_newpage_print);
|
||||
REC_INTRO(__ham_newpage_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __ham_splitmeta_recover --
|
||||
* Recovery function for splitmeta.
|
||||
*
|
||||
* PUBLIC: int __ham_splitmeta_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__ham_splitmeta_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__ham_splitmeta_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__ham_splitmeta_print);
|
||||
REC_INTRO(__ham_splitmeta_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __ham_splitdata_recover --
|
||||
* Recovery function for splitdata.
|
||||
*
|
||||
* PUBLIC: int __ham_splitdata_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__ham_splitdata_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__ham_splitdata_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__ham_splitdata_print);
|
||||
REC_INTRO(__ham_splitdata_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __ham_replace_recover --
|
||||
* Recovery function for replace.
|
||||
*
|
||||
* PUBLIC: int __ham_replace_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__ham_replace_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__ham_replace_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__ham_replace_print);
|
||||
REC_INTRO(__ham_replace_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __ham_newpgno_recover --
|
||||
* Recovery function for newpgno.
|
||||
*
|
||||
* PUBLIC: int __ham_newpgno_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__ham_newpgno_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__ham_newpgno_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__ham_newpgno_print);
|
||||
REC_INTRO(__ham_newpgno_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __ham_ovfl_recover --
|
||||
* Recovery function for ovfl.
|
||||
*
|
||||
* PUBLIC: int __ham_ovfl_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__ham_ovfl_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__ham_ovfl_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__ham_ovfl_print);
|
||||
REC_INTRO(__ham_ovfl_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __ham_copypage_recover --
|
||||
* Recovery function for copypage.
|
||||
*
|
||||
* PUBLIC: int __ham_copypage_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__ham_copypage_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__ham_copypage_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__ham_copypage_print);
|
||||
REC_INTRO(__ham_copypage_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __ham_metagroup_recover --
|
||||
* Recovery function for metagroup.
|
||||
*
|
||||
* PUBLIC: int __ham_metagroup_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__ham_metagroup_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__ham_metagroup_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__ham_metagroup_print);
|
||||
REC_INTRO(__ham_metagroup_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __ham_groupalloc1_recover --
|
||||
* Recovery function for groupalloc1.
|
||||
*
|
||||
* PUBLIC: int __ham_groupalloc1_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__ham_groupalloc1_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__ham_groupalloc1_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__ham_groupalloc1_print);
|
||||
REC_INTRO(__ham_groupalloc1_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __ham_groupalloc2_recover --
|
||||
* Recovery function for groupalloc2.
|
||||
*
|
||||
* PUBLIC: int __ham_groupalloc2_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__ham_groupalloc2_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__ham_groupalloc2_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__ham_groupalloc2_print);
|
||||
REC_INTRO(__ham_groupalloc2_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __ham_groupalloc_recover --
|
||||
* Recovery function for groupalloc.
|
||||
*
|
||||
* PUBLIC: int __ham_groupalloc_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__ham_groupalloc_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__ham_groupalloc_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__ham_groupalloc_print);
|
||||
REC_INTRO(__ham_groupalloc_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __ham_curadj_recover --
|
||||
* Recovery function for curadj.
|
||||
*
|
||||
* PUBLIC: int __ham_curadj_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__ham_curadj_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__ham_curadj_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__ham_curadj_print);
|
||||
REC_INTRO(__ham_curadj_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __ham_chgpg_recover --
|
||||
* Recovery function for chgpg.
|
||||
*
|
||||
* PUBLIC: int __ham_chgpg_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__ham_chgpg_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__ham_chgpg_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__ham_chgpg_print);
|
||||
REC_INTRO(__ham_chgpg_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
137
bdb/dist/template/rec_log
vendored
137
bdb/dist/template/rec_log
vendored
|
@ -1,137 +0,0 @@
|
|||
#include "db_config.h"
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#include "db_int.h"
|
||||
#include "db_page.h"
|
||||
#include "log.h"
|
||||
#include "log.h"
|
||||
|
||||
/*
|
||||
* __log_register1_recover --
|
||||
* Recovery function for register1.
|
||||
*
|
||||
* PUBLIC: int __log_register1_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__log_register1_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__log_register1_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__log_register1_print);
|
||||
REC_INTRO(__log_register1_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __log_register_recover --
|
||||
* Recovery function for register.
|
||||
*
|
||||
* PUBLIC: int __log_register_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__log_register_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__log_register_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__log_register_print);
|
||||
REC_INTRO(__log_register_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
509
bdb/dist/template/rec_qam
vendored
509
bdb/dist/template/rec_qam
vendored
|
@ -1,509 +0,0 @@
|
|||
#include "db_config.h"
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#include "db_int.h"
|
||||
#include "db_page.h"
|
||||
#include "qam.h"
|
||||
#include "log.h"
|
||||
|
||||
/*
|
||||
* __qam_inc_recover --
|
||||
* Recovery function for inc.
|
||||
*
|
||||
* PUBLIC: int __qam_inc_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__qam_inc_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__qam_inc_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__qam_inc_print);
|
||||
REC_INTRO(__qam_inc_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __qam_incfirst_recover --
|
||||
* Recovery function for incfirst.
|
||||
*
|
||||
* PUBLIC: int __qam_incfirst_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__qam_incfirst_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__qam_incfirst_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__qam_incfirst_print);
|
||||
REC_INTRO(__qam_incfirst_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __qam_mvptr_recover --
|
||||
* Recovery function for mvptr.
|
||||
*
|
||||
* PUBLIC: int __qam_mvptr_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__qam_mvptr_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__qam_mvptr_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__qam_mvptr_print);
|
||||
REC_INTRO(__qam_mvptr_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __qam_del_recover --
|
||||
* Recovery function for del.
|
||||
*
|
||||
* PUBLIC: int __qam_del_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__qam_del_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__qam_del_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__qam_del_print);
|
||||
REC_INTRO(__qam_del_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __qam_add_recover --
|
||||
* Recovery function for add.
|
||||
*
|
||||
* PUBLIC: int __qam_add_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__qam_add_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__qam_add_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__qam_add_print);
|
||||
REC_INTRO(__qam_add_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __qam_delete_recover --
|
||||
* Recovery function for delete.
|
||||
*
|
||||
* PUBLIC: int __qam_delete_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__qam_delete_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__qam_delete_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__qam_delete_print);
|
||||
REC_INTRO(__qam_delete_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __qam_rename_recover --
|
||||
* Recovery function for rename.
|
||||
*
|
||||
* PUBLIC: int __qam_rename_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__qam_rename_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__qam_rename_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__qam_rename_print);
|
||||
REC_INTRO(__qam_rename_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __qam_delext_recover --
|
||||
* Recovery function for delext.
|
||||
*
|
||||
* PUBLIC: int __qam_delext_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__qam_delext_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__qam_delext_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__qam_delext_print);
|
||||
REC_INTRO(__qam_delext_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
509
bdb/dist/template/rec_txn
vendored
509
bdb/dist/template/rec_txn
vendored
|
@ -1,509 +0,0 @@
|
|||
#include "db_config.h"
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#include "db_int.h"
|
||||
#include "db_page.h"
|
||||
#include "txn.h"
|
||||
#include "log.h"
|
||||
|
||||
/*
|
||||
* __txn_old_regop_recover --
|
||||
* Recovery function for old_regop.
|
||||
*
|
||||
* PUBLIC: int __txn_old_regop_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__txn_old_regop_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__txn_old_regop_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__txn_old_regop_print);
|
||||
REC_INTRO(__txn_old_regop_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __txn_regop_recover --
|
||||
* Recovery function for regop.
|
||||
*
|
||||
* PUBLIC: int __txn_regop_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__txn_regop_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__txn_regop_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__txn_regop_print);
|
||||
REC_INTRO(__txn_regop_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __txn_old_ckp_recover --
|
||||
* Recovery function for old_ckp.
|
||||
*
|
||||
* PUBLIC: int __txn_old_ckp_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__txn_old_ckp_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__txn_old_ckp_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__txn_old_ckp_print);
|
||||
REC_INTRO(__txn_old_ckp_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __txn_ckp_recover --
|
||||
* Recovery function for ckp.
|
||||
*
|
||||
* PUBLIC: int __txn_ckp_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__txn_ckp_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__txn_ckp_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__txn_ckp_print);
|
||||
REC_INTRO(__txn_ckp_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __txn_xa_regop_old_recover --
|
||||
* Recovery function for xa_regop_old.
|
||||
*
|
||||
* PUBLIC: int __txn_xa_regop_old_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__txn_xa_regop_old_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__txn_xa_regop_old_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__txn_xa_regop_old_print);
|
||||
REC_INTRO(__txn_xa_regop_old_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __txn_xa_regop_recover --
|
||||
* Recovery function for xa_regop.
|
||||
*
|
||||
* PUBLIC: int __txn_xa_regop_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__txn_xa_regop_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__txn_xa_regop_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__txn_xa_regop_print);
|
||||
REC_INTRO(__txn_xa_regop_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __txn_child_old_recover --
|
||||
* Recovery function for child_old.
|
||||
*
|
||||
* PUBLIC: int __txn_child_old_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__txn_child_old_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__txn_child_old_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__txn_child_old_print);
|
||||
REC_INTRO(__txn_child_old_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* __txn_child_recover --
|
||||
* Recovery function for child.
|
||||
*
|
||||
* PUBLIC: int __txn_child_recover
|
||||
* PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
*/
|
||||
int
|
||||
__txn_child_recover(dbenv, dbtp, lsnp, op, info)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops op;
|
||||
void *info;
|
||||
{
|
||||
__txn_child_args *argp;
|
||||
DB *file_dbp;
|
||||
DBC *dbc;
|
||||
DB_MPOOLFILE *mpf;
|
||||
PAGE *pagep;
|
||||
int cmp_n, cmp_p, modified, ret;
|
||||
|
||||
REC_PRINT(__txn_child_print);
|
||||
REC_INTRO(__txn_child_read);
|
||||
|
||||
if ((ret = memp_fget(mpf, &argp->pgno, 0, &pagep)) != 0)
|
||||
if (DB_REDO(op)) {
|
||||
if ((ret = memp_fget(mpf,
|
||||
&argp->pgno, DB_MPOOL_CREATE, &pagep)) != 0)
|
||||
goto out;
|
||||
} else {
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
modified = 0;
|
||||
cmp_n = log_compare(lsnp, &LSN(pagep));
|
||||
|
||||
/*
|
||||
* Use this when there is something like "pagelsn" in the argp
|
||||
* structure. Sometimes, you might need to compare meta-data
|
||||
* lsn's instead.
|
||||
*
|
||||
* cmp_p = log_compare(&LSN(pagep), argp->pagelsn);
|
||||
*/
|
||||
if (cmp_p == 0 && DB_REDO(op)) {
|
||||
/* Need to redo update described. */
|
||||
modified = 1;
|
||||
} else if (cmp_n == 0 && !DB_REDO(op)) {
|
||||
/* Need to undo update described. */
|
||||
modified = 1;
|
||||
}
|
||||
if (ret = memp_fput(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0))
|
||||
goto out;
|
||||
|
||||
*lsnp = argp->prev_lsn;
|
||||
ret = 0;
|
||||
|
||||
out: REC_CLOSE;
|
||||
}
|
||||
|
2023
bdb/hash/hash_auto.c
2023
bdb/hash/hash_auto.c
File diff suppressed because it is too large
Load diff
|
@ -1,267 +0,0 @@
|
|||
/* Do not edit: automatically built by gen_rec.awk. */
|
||||
|
||||
#ifndef bam_AUTO_H
|
||||
#define bam_AUTO_H
|
||||
|
||||
#define DB_bam_pg_alloc 51
|
||||
typedef struct _bam_pg_alloc_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
DB_LSN meta_lsn;
|
||||
DB_LSN page_lsn;
|
||||
db_pgno_t pgno;
|
||||
u_int32_t ptype;
|
||||
db_pgno_t next;
|
||||
} __bam_pg_alloc_args;
|
||||
|
||||
int __bam_pg_alloc_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, DB_LSN *, DB_LSN *, db_pgno_t, u_int32_t, db_pgno_t));
|
||||
int __bam_pg_alloc_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __bam_pg_alloc_read __P((DB_ENV *, void *, __bam_pg_alloc_args **));
|
||||
|
||||
#define DB_bam_pg_alloc1 60
|
||||
typedef struct _bam_pg_alloc1_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
DB_LSN meta_lsn;
|
||||
DB_LSN alloc_lsn;
|
||||
DB_LSN page_lsn;
|
||||
db_pgno_t pgno;
|
||||
u_int32_t ptype;
|
||||
db_pgno_t next;
|
||||
} __bam_pg_alloc1_args;
|
||||
|
||||
int __bam_pg_alloc1_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __bam_pg_alloc1_read __P((DB_ENV *, void *, __bam_pg_alloc1_args **));
|
||||
|
||||
#define DB_bam_pg_free 52
|
||||
typedef struct _bam_pg_free_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
db_pgno_t pgno;
|
||||
DB_LSN meta_lsn;
|
||||
DBT header;
|
||||
db_pgno_t next;
|
||||
} __bam_pg_free_args;
|
||||
|
||||
int __bam_pg_free_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, DB_LSN *, const DBT *, db_pgno_t));
|
||||
int __bam_pg_free_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __bam_pg_free_read __P((DB_ENV *, void *, __bam_pg_free_args **));
|
||||
|
||||
#define DB_bam_pg_free1 61
|
||||
typedef struct _bam_pg_free1_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
db_pgno_t pgno;
|
||||
DB_LSN meta_lsn;
|
||||
DB_LSN alloc_lsn;
|
||||
DBT header;
|
||||
db_pgno_t next;
|
||||
} __bam_pg_free1_args;
|
||||
|
||||
int __bam_pg_free1_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __bam_pg_free1_read __P((DB_ENV *, void *, __bam_pg_free1_args **));
|
||||
|
||||
#define DB_bam_split1 53
|
||||
typedef struct _bam_split1_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
db_pgno_t left;
|
||||
DB_LSN llsn;
|
||||
db_pgno_t right;
|
||||
DB_LSN rlsn;
|
||||
u_int32_t indx;
|
||||
db_pgno_t npgno;
|
||||
DB_LSN nlsn;
|
||||
DBT pg;
|
||||
} __bam_split1_args;
|
||||
|
||||
int __bam_split1_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __bam_split1_read __P((DB_ENV *, void *, __bam_split1_args **));
|
||||
|
||||
#define DB_bam_split 62
|
||||
typedef struct _bam_split_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
db_pgno_t left;
|
||||
DB_LSN llsn;
|
||||
db_pgno_t right;
|
||||
DB_LSN rlsn;
|
||||
u_int32_t indx;
|
||||
db_pgno_t npgno;
|
||||
DB_LSN nlsn;
|
||||
db_pgno_t root_pgno;
|
||||
DBT pg;
|
||||
u_int32_t opflags;
|
||||
} __bam_split_args;
|
||||
|
||||
int __bam_split_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, u_int32_t, db_pgno_t, DB_LSN *, db_pgno_t, const DBT *, u_int32_t));
|
||||
int __bam_split_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __bam_split_read __P((DB_ENV *, void *, __bam_split_args **));
|
||||
|
||||
#define DB_bam_rsplit1 54
|
||||
typedef struct _bam_rsplit1_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
db_pgno_t pgno;
|
||||
DBT pgdbt;
|
||||
db_pgno_t nrec;
|
||||
DBT rootent;
|
||||
DB_LSN rootlsn;
|
||||
} __bam_rsplit1_args;
|
||||
|
||||
int __bam_rsplit1_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __bam_rsplit1_read __P((DB_ENV *, void *, __bam_rsplit1_args **));
|
||||
|
||||
#define DB_bam_rsplit 63
|
||||
typedef struct _bam_rsplit_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
db_pgno_t pgno;
|
||||
DBT pgdbt;
|
||||
db_pgno_t root_pgno;
|
||||
db_pgno_t nrec;
|
||||
DBT rootent;
|
||||
DB_LSN rootlsn;
|
||||
} __bam_rsplit_args;
|
||||
|
||||
int __bam_rsplit_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, const DBT *, db_pgno_t, db_pgno_t, const DBT *, DB_LSN *));
|
||||
int __bam_rsplit_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __bam_rsplit_read __P((DB_ENV *, void *, __bam_rsplit_args **));
|
||||
|
||||
#define DB_bam_adj 55
|
||||
typedef struct _bam_adj_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
db_pgno_t pgno;
|
||||
DB_LSN lsn;
|
||||
u_int32_t indx;
|
||||
u_int32_t indx_copy;
|
||||
u_int32_t is_insert;
|
||||
} __bam_adj_args;
|
||||
|
||||
int __bam_adj_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, DB_LSN *, u_int32_t, u_int32_t, u_int32_t));
|
||||
int __bam_adj_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __bam_adj_read __P((DB_ENV *, void *, __bam_adj_args **));
|
||||
|
||||
#define DB_bam_cadjust 56
|
||||
typedef struct _bam_cadjust_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
db_pgno_t pgno;
|
||||
DB_LSN lsn;
|
||||
u_int32_t indx;
|
||||
int32_t adjust;
|
||||
u_int32_t opflags;
|
||||
} __bam_cadjust_args;
|
||||
|
||||
int __bam_cadjust_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, DB_LSN *, u_int32_t, int32_t, u_int32_t));
|
||||
int __bam_cadjust_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __bam_cadjust_read __P((DB_ENV *, void *, __bam_cadjust_args **));
|
||||
|
||||
#define DB_bam_cdel 57
|
||||
typedef struct _bam_cdel_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
db_pgno_t pgno;
|
||||
DB_LSN lsn;
|
||||
u_int32_t indx;
|
||||
} __bam_cdel_args;
|
||||
|
||||
int __bam_cdel_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, DB_LSN *, u_int32_t));
|
||||
int __bam_cdel_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __bam_cdel_read __P((DB_ENV *, void *, __bam_cdel_args **));
|
||||
|
||||
#define DB_bam_repl 58
|
||||
typedef struct _bam_repl_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
db_pgno_t pgno;
|
||||
DB_LSN lsn;
|
||||
u_int32_t indx;
|
||||
u_int32_t isdeleted;
|
||||
DBT orig;
|
||||
DBT repl;
|
||||
u_int32_t prefix;
|
||||
u_int32_t suffix;
|
||||
} __bam_repl_args;
|
||||
|
||||
int __bam_repl_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, DB_LSN *, u_int32_t, u_int32_t, const DBT *, const DBT *, u_int32_t, u_int32_t));
|
||||
int __bam_repl_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __bam_repl_read __P((DB_ENV *, void *, __bam_repl_args **));
|
||||
|
||||
#define DB_bam_root 59
|
||||
typedef struct _bam_root_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
db_pgno_t meta_pgno;
|
||||
db_pgno_t root_pgno;
|
||||
DB_LSN meta_lsn;
|
||||
} __bam_root_args;
|
||||
|
||||
int __bam_root_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, db_pgno_t, DB_LSN *));
|
||||
int __bam_root_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __bam_root_read __P((DB_ENV *, void *, __bam_root_args **));
|
||||
|
||||
#define DB_bam_curadj 64
|
||||
typedef struct _bam_curadj_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
db_ca_mode mode;
|
||||
db_pgno_t from_pgno;
|
||||
db_pgno_t to_pgno;
|
||||
db_pgno_t left_pgno;
|
||||
u_int32_t first_indx;
|
||||
u_int32_t from_indx;
|
||||
u_int32_t to_indx;
|
||||
} __bam_curadj_args;
|
||||
|
||||
int __bam_curadj_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_ca_mode, db_pgno_t, db_pgno_t, db_pgno_t, u_int32_t, u_int32_t, u_int32_t));
|
||||
int __bam_curadj_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __bam_curadj_read __P((DB_ENV *, void *, __bam_curadj_args **));
|
||||
|
||||
#define DB_bam_rcuradj 65
|
||||
typedef struct _bam_rcuradj_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
ca_recno_arg mode;
|
||||
db_pgno_t root;
|
||||
db_recno_t recno;
|
||||
u_int32_t order;
|
||||
} __bam_rcuradj_args;
|
||||
|
||||
int __bam_rcuradj_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, ca_recno_arg, db_pgno_t, db_recno_t, u_int32_t));
|
||||
int __bam_rcuradj_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __bam_rcuradj_read __P((DB_ENV *, void *, __bam_rcuradj_args **));
|
||||
int __bam_init_print __P((DB_ENV *));
|
||||
int __bam_init_recover __P((DB_ENV *));
|
||||
#endif
|
|
@ -1,88 +0,0 @@
|
|||
/* Do not edit: automatically built by gen_rec.awk. */
|
||||
|
||||
#ifndef crdel_AUTO_H
|
||||
#define crdel_AUTO_H
|
||||
|
||||
#define DB_crdel_fileopen 141
|
||||
typedef struct _crdel_fileopen_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
DBT name;
|
||||
u_int32_t mode;
|
||||
} __crdel_fileopen_args;
|
||||
|
||||
int __crdel_fileopen_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, const DBT *, u_int32_t));
|
||||
int __crdel_fileopen_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __crdel_fileopen_read __P((DB_ENV *, void *, __crdel_fileopen_args **));
|
||||
|
||||
#define DB_crdel_metasub 142
|
||||
typedef struct _crdel_metasub_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
db_pgno_t pgno;
|
||||
DBT page;
|
||||
DB_LSN lsn;
|
||||
} __crdel_metasub_args;
|
||||
|
||||
int __crdel_metasub_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, const DBT *, DB_LSN *));
|
||||
int __crdel_metasub_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __crdel_metasub_read __P((DB_ENV *, void *, __crdel_metasub_args **));
|
||||
|
||||
#define DB_crdel_metapage 143
|
||||
typedef struct _crdel_metapage_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
DBT name;
|
||||
db_pgno_t pgno;
|
||||
DBT page;
|
||||
} __crdel_metapage_args;
|
||||
|
||||
int __crdel_metapage_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, const DBT *, db_pgno_t, const DBT *));
|
||||
int __crdel_metapage_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __crdel_metapage_read __P((DB_ENV *, void *, __crdel_metapage_args **));
|
||||
|
||||
#define DB_crdel_old_delete 144
|
||||
typedef struct _crdel_old_delete_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
DBT name;
|
||||
} __crdel_old_delete_args;
|
||||
|
||||
int __crdel_old_delete_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __crdel_old_delete_read __P((DB_ENV *, void *, __crdel_old_delete_args **));
|
||||
|
||||
#define DB_crdel_rename 145
|
||||
typedef struct _crdel_rename_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
DBT name;
|
||||
DBT newname;
|
||||
} __crdel_rename_args;
|
||||
|
||||
int __crdel_rename_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, const DBT *, const DBT *));
|
||||
int __crdel_rename_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __crdel_rename_read __P((DB_ENV *, void *, __crdel_rename_args **));
|
||||
|
||||
#define DB_crdel_delete 146
|
||||
typedef struct _crdel_delete_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
DBT name;
|
||||
} __crdel_delete_args;
|
||||
|
||||
int __crdel_delete_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, const DBT *));
|
||||
int __crdel_delete_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __crdel_delete_read __P((DB_ENV *, void *, __crdel_delete_args **));
|
||||
int __crdel_init_print __P((DB_ENV *));
|
||||
int __crdel_init_recover __P((DB_ENV *));
|
||||
#endif
|
|
@ -1,140 +0,0 @@
|
|||
/* Do not edit: automatically built by gen_rec.awk. */
|
||||
|
||||
#ifndef db_AUTO_H
|
||||
#define db_AUTO_H
|
||||
|
||||
#define DB_db_addrem 41
|
||||
typedef struct _db_addrem_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
u_int32_t opcode;
|
||||
int32_t fileid;
|
||||
db_pgno_t pgno;
|
||||
u_int32_t indx;
|
||||
size_t nbytes;
|
||||
DBT hdr;
|
||||
DBT dbt;
|
||||
DB_LSN pagelsn;
|
||||
} __db_addrem_args;
|
||||
|
||||
int __db_addrem_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, int32_t, db_pgno_t, u_int32_t, size_t, const DBT *, const DBT *, DB_LSN *));
|
||||
int __db_addrem_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __db_addrem_read __P((DB_ENV *, void *, __db_addrem_args **));
|
||||
|
||||
#define DB_db_split 42
|
||||
typedef struct _db_split_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
u_int32_t opcode;
|
||||
int32_t fileid;
|
||||
db_pgno_t pgno;
|
||||
DBT pageimage;
|
||||
DB_LSN pagelsn;
|
||||
} __db_split_args;
|
||||
|
||||
int __db_split_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __db_split_read __P((DB_ENV *, void *, __db_split_args **));
|
||||
|
||||
#define DB_db_big 43
|
||||
typedef struct _db_big_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
u_int32_t opcode;
|
||||
int32_t fileid;
|
||||
db_pgno_t pgno;
|
||||
db_pgno_t prev_pgno;
|
||||
db_pgno_t next_pgno;
|
||||
DBT dbt;
|
||||
DB_LSN pagelsn;
|
||||
DB_LSN prevlsn;
|
||||
DB_LSN nextlsn;
|
||||
} __db_big_args;
|
||||
|
||||
int __db_big_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, int32_t, db_pgno_t, db_pgno_t, db_pgno_t, const DBT *, DB_LSN *, DB_LSN *, DB_LSN *));
|
||||
int __db_big_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __db_big_read __P((DB_ENV *, void *, __db_big_args **));
|
||||
|
||||
#define DB_db_ovref 44
|
||||
typedef struct _db_ovref_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
db_pgno_t pgno;
|
||||
int32_t adjust;
|
||||
DB_LSN lsn;
|
||||
} __db_ovref_args;
|
||||
|
||||
int __db_ovref_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, int32_t, DB_LSN *));
|
||||
int __db_ovref_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __db_ovref_read __P((DB_ENV *, void *, __db_ovref_args **));
|
||||
|
||||
#define DB_db_relink 45
|
||||
typedef struct _db_relink_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
u_int32_t opcode;
|
||||
int32_t fileid;
|
||||
db_pgno_t pgno;
|
||||
DB_LSN lsn;
|
||||
db_pgno_t prev;
|
||||
DB_LSN lsn_prev;
|
||||
db_pgno_t next;
|
||||
DB_LSN lsn_next;
|
||||
} __db_relink_args;
|
||||
|
||||
int __db_relink_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *));
|
||||
int __db_relink_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __db_relink_read __P((DB_ENV *, void *, __db_relink_args **));
|
||||
|
||||
#define DB_db_addpage 46
|
||||
typedef struct _db_addpage_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
db_pgno_t pgno;
|
||||
DB_LSN lsn;
|
||||
db_pgno_t nextpgno;
|
||||
DB_LSN nextlsn;
|
||||
} __db_addpage_args;
|
||||
|
||||
int __db_addpage_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __db_addpage_read __P((DB_ENV *, void *, __db_addpage_args **));
|
||||
|
||||
#define DB_db_debug 47
|
||||
typedef struct _db_debug_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
DBT op;
|
||||
int32_t fileid;
|
||||
DBT key;
|
||||
DBT data;
|
||||
u_int32_t arg_flags;
|
||||
} __db_debug_args;
|
||||
|
||||
int __db_debug_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, const DBT *, int32_t, const DBT *, const DBT *, u_int32_t));
|
||||
int __db_debug_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __db_debug_read __P((DB_ENV *, void *, __db_debug_args **));
|
||||
|
||||
#define DB_db_noop 48
|
||||
typedef struct _db_noop_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
db_pgno_t pgno;
|
||||
DB_LSN prevlsn;
|
||||
} __db_noop_args;
|
||||
|
||||
int __db_noop_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, DB_LSN *));
|
||||
int __db_noop_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __db_noop_read __P((DB_ENV *, void *, __db_noop_args **));
|
||||
int __db_init_print __P((DB_ENV *));
|
||||
int __db_init_recover __P((DB_ENV *));
|
||||
#endif
|
|
@ -1,762 +0,0 @@
|
|||
/*
|
||||
* Please do not edit this file.
|
||||
* It was generated using rpcgen.
|
||||
*/
|
||||
|
||||
#ifndef _DB_SERVER_H_RPCGEN
|
||||
#define _DB_SERVER_H_RPCGEN
|
||||
|
||||
#include <rpc/rpc.h>
|
||||
|
||||
struct __env_cachesize_msg {
|
||||
u_int dbenvcl_id;
|
||||
u_int gbytes;
|
||||
u_int bytes;
|
||||
u_int ncache;
|
||||
};
|
||||
typedef struct __env_cachesize_msg __env_cachesize_msg;
|
||||
|
||||
struct __env_cachesize_reply {
|
||||
u_int status;
|
||||
};
|
||||
typedef struct __env_cachesize_reply __env_cachesize_reply;
|
||||
|
||||
struct __env_close_msg {
|
||||
u_int dbenvcl_id;
|
||||
u_int flags;
|
||||
};
|
||||
typedef struct __env_close_msg __env_close_msg;
|
||||
|
||||
struct __env_close_reply {
|
||||
u_int status;
|
||||
};
|
||||
typedef struct __env_close_reply __env_close_reply;
|
||||
|
||||
struct __env_create_msg {
|
||||
u_int timeout;
|
||||
};
|
||||
typedef struct __env_create_msg __env_create_msg;
|
||||
|
||||
struct __env_create_reply {
|
||||
u_int status;
|
||||
u_int envcl_id;
|
||||
};
|
||||
typedef struct __env_create_reply __env_create_reply;
|
||||
|
||||
struct __env_flags_msg {
|
||||
u_int dbenvcl_id;
|
||||
u_int flags;
|
||||
u_int onoff;
|
||||
};
|
||||
typedef struct __env_flags_msg __env_flags_msg;
|
||||
|
||||
struct __env_flags_reply {
|
||||
u_int status;
|
||||
};
|
||||
typedef struct __env_flags_reply __env_flags_reply;
|
||||
|
||||
struct __env_open_msg {
|
||||
u_int dbenvcl_id;
|
||||
char *home;
|
||||
u_int flags;
|
||||
u_int mode;
|
||||
};
|
||||
typedef struct __env_open_msg __env_open_msg;
|
||||
|
||||
struct __env_open_reply {
|
||||
u_int status;
|
||||
};
|
||||
typedef struct __env_open_reply __env_open_reply;
|
||||
|
||||
struct __env_remove_msg {
|
||||
u_int dbenvcl_id;
|
||||
char *home;
|
||||
u_int flags;
|
||||
};
|
||||
typedef struct __env_remove_msg __env_remove_msg;
|
||||
|
||||
struct __env_remove_reply {
|
||||
u_int status;
|
||||
};
|
||||
typedef struct __env_remove_reply __env_remove_reply;
|
||||
|
||||
struct __txn_abort_msg {
|
||||
u_int txnpcl_id;
|
||||
};
|
||||
typedef struct __txn_abort_msg __txn_abort_msg;
|
||||
|
||||
struct __txn_abort_reply {
|
||||
u_int status;
|
||||
};
|
||||
typedef struct __txn_abort_reply __txn_abort_reply;
|
||||
|
||||
struct __txn_begin_msg {
|
||||
u_int envpcl_id;
|
||||
u_int parentcl_id;
|
||||
u_int flags;
|
||||
};
|
||||
typedef struct __txn_begin_msg __txn_begin_msg;
|
||||
|
||||
struct __txn_begin_reply {
|
||||
u_int status;
|
||||
u_int txnidcl_id;
|
||||
};
|
||||
typedef struct __txn_begin_reply __txn_begin_reply;
|
||||
|
||||
struct __txn_commit_msg {
|
||||
u_int txnpcl_id;
|
||||
u_int flags;
|
||||
};
|
||||
typedef struct __txn_commit_msg __txn_commit_msg;
|
||||
|
||||
struct __txn_commit_reply {
|
||||
u_int status;
|
||||
};
|
||||
typedef struct __txn_commit_reply __txn_commit_reply;
|
||||
|
||||
struct __db_bt_maxkey_msg {
|
||||
u_int dbpcl_id;
|
||||
u_int maxkey;
|
||||
};
|
||||
typedef struct __db_bt_maxkey_msg __db_bt_maxkey_msg;
|
||||
|
||||
struct __db_bt_maxkey_reply {
|
||||
u_int status;
|
||||
};
|
||||
typedef struct __db_bt_maxkey_reply __db_bt_maxkey_reply;
|
||||
|
||||
struct __db_bt_minkey_msg {
|
||||
u_int dbpcl_id;
|
||||
u_int minkey;
|
||||
};
|
||||
typedef struct __db_bt_minkey_msg __db_bt_minkey_msg;
|
||||
|
||||
struct __db_bt_minkey_reply {
|
||||
u_int status;
|
||||
};
|
||||
typedef struct __db_bt_minkey_reply __db_bt_minkey_reply;
|
||||
|
||||
struct __db_close_msg {
|
||||
u_int dbpcl_id;
|
||||
u_int flags;
|
||||
};
|
||||
typedef struct __db_close_msg __db_close_msg;
|
||||
|
||||
struct __db_close_reply {
|
||||
u_int status;
|
||||
};
|
||||
typedef struct __db_close_reply __db_close_reply;
|
||||
|
||||
struct __db_create_msg {
|
||||
u_int flags;
|
||||
u_int envpcl_id;
|
||||
};
|
||||
typedef struct __db_create_msg __db_create_msg;
|
||||
|
||||
struct __db_create_reply {
|
||||
u_int status;
|
||||
u_int dbpcl_id;
|
||||
};
|
||||
typedef struct __db_create_reply __db_create_reply;
|
||||
|
||||
struct __db_del_msg {
|
||||
u_int dbpcl_id;
|
||||
u_int txnpcl_id;
|
||||
u_int keydlen;
|
||||
u_int keydoff;
|
||||
u_int keyflags;
|
||||
struct {
|
||||
u_int keydata_len;
|
||||
char *keydata_val;
|
||||
} keydata;
|
||||
u_int flags;
|
||||
};
|
||||
typedef struct __db_del_msg __db_del_msg;
|
||||
|
||||
struct __db_del_reply {
|
||||
u_int status;
|
||||
};
|
||||
typedef struct __db_del_reply __db_del_reply;
|
||||
|
||||
struct __db_extentsize_msg {
|
||||
u_int dbpcl_id;
|
||||
u_int extentsize;
|
||||
};
|
||||
typedef struct __db_extentsize_msg __db_extentsize_msg;
|
||||
|
||||
struct __db_extentsize_reply {
|
||||
u_int status;
|
||||
};
|
||||
typedef struct __db_extentsize_reply __db_extentsize_reply;
|
||||
|
||||
struct __db_flags_msg {
|
||||
u_int dbpcl_id;
|
||||
u_int flags;
|
||||
};
|
||||
typedef struct __db_flags_msg __db_flags_msg;
|
||||
|
||||
struct __db_flags_reply {
|
||||
u_int status;
|
||||
};
|
||||
typedef struct __db_flags_reply __db_flags_reply;
|
||||
|
||||
struct __db_get_msg {
|
||||
u_int dbpcl_id;
|
||||
u_int txnpcl_id;
|
||||
u_int keydlen;
|
||||
u_int keydoff;
|
||||
u_int keyflags;
|
||||
struct {
|
||||
u_int keydata_len;
|
||||
char *keydata_val;
|
||||
} keydata;
|
||||
u_int datadlen;
|
||||
u_int datadoff;
|
||||
u_int dataflags;
|
||||
struct {
|
||||
u_int datadata_len;
|
||||
char *datadata_val;
|
||||
} datadata;
|
||||
u_int flags;
|
||||
};
|
||||
typedef struct __db_get_msg __db_get_msg;
|
||||
|
||||
struct __db_get_reply {
|
||||
u_int status;
|
||||
struct {
|
||||
u_int keydata_len;
|
||||
char *keydata_val;
|
||||
} keydata;
|
||||
struct {
|
||||
u_int datadata_len;
|
||||
char *datadata_val;
|
||||
} datadata;
|
||||
};
|
||||
typedef struct __db_get_reply __db_get_reply;
|
||||
|
||||
struct __db_h_ffactor_msg {
|
||||
u_int dbpcl_id;
|
||||
u_int ffactor;
|
||||
};
|
||||
typedef struct __db_h_ffactor_msg __db_h_ffactor_msg;
|
||||
|
||||
struct __db_h_ffactor_reply {
|
||||
u_int status;
|
||||
};
|
||||
typedef struct __db_h_ffactor_reply __db_h_ffactor_reply;
|
||||
|
||||
struct __db_h_nelem_msg {
|
||||
u_int dbpcl_id;
|
||||
u_int nelem;
|
||||
};
|
||||
typedef struct __db_h_nelem_msg __db_h_nelem_msg;
|
||||
|
||||
struct __db_h_nelem_reply {
|
||||
u_int status;
|
||||
};
|
||||
typedef struct __db_h_nelem_reply __db_h_nelem_reply;
|
||||
|
||||
struct __db_key_range_msg {
|
||||
u_int dbpcl_id;
|
||||
u_int txnpcl_id;
|
||||
u_int keydlen;
|
||||
u_int keydoff;
|
||||
u_int keyflags;
|
||||
struct {
|
||||
u_int keydata_len;
|
||||
char *keydata_val;
|
||||
} keydata;
|
||||
u_int flags;
|
||||
};
|
||||
typedef struct __db_key_range_msg __db_key_range_msg;
|
||||
|
||||
struct __db_key_range_reply {
|
||||
u_int status;
|
||||
double less;
|
||||
double equal;
|
||||
double greater;
|
||||
};
|
||||
typedef struct __db_key_range_reply __db_key_range_reply;
|
||||
|
||||
struct __db_lorder_msg {
|
||||
u_int dbpcl_id;
|
||||
u_int lorder;
|
||||
};
|
||||
typedef struct __db_lorder_msg __db_lorder_msg;
|
||||
|
||||
struct __db_lorder_reply {
|
||||
u_int status;
|
||||
};
|
||||
typedef struct __db_lorder_reply __db_lorder_reply;
|
||||
|
||||
struct __db_open_msg {
|
||||
u_int dbpcl_id;
|
||||
char *name;
|
||||
char *subdb;
|
||||
u_int type;
|
||||
u_int flags;
|
||||
u_int mode;
|
||||
};
|
||||
typedef struct __db_open_msg __db_open_msg;
|
||||
|
||||
struct __db_open_reply {
|
||||
u_int status;
|
||||
u_int type;
|
||||
u_int dbflags;
|
||||
};
|
||||
typedef struct __db_open_reply __db_open_reply;
|
||||
|
||||
struct __db_pagesize_msg {
|
||||
u_int dbpcl_id;
|
||||
u_int pagesize;
|
||||
};
|
||||
typedef struct __db_pagesize_msg __db_pagesize_msg;
|
||||
|
||||
struct __db_pagesize_reply {
|
||||
u_int status;
|
||||
};
|
||||
typedef struct __db_pagesize_reply __db_pagesize_reply;
|
||||
|
||||
struct __db_put_msg {
|
||||
u_int dbpcl_id;
|
||||
u_int txnpcl_id;
|
||||
u_int keydlen;
|
||||
u_int keydoff;
|
||||
u_int keyflags;
|
||||
struct {
|
||||
u_int keydata_len;
|
||||
char *keydata_val;
|
||||
} keydata;
|
||||
u_int datadlen;
|
||||
u_int datadoff;
|
||||
u_int dataflags;
|
||||
struct {
|
||||
u_int datadata_len;
|
||||
char *datadata_val;
|
||||
} datadata;
|
||||
u_int flags;
|
||||
};
|
||||
typedef struct __db_put_msg __db_put_msg;
|
||||
|
||||
struct __db_put_reply {
|
||||
u_int status;
|
||||
struct {
|
||||
u_int keydata_len;
|
||||
char *keydata_val;
|
||||
} keydata;
|
||||
};
|
||||
typedef struct __db_put_reply __db_put_reply;
|
||||
|
||||
struct __db_re_delim_msg {
|
||||
u_int dbpcl_id;
|
||||
u_int delim;
|
||||
};
|
||||
typedef struct __db_re_delim_msg __db_re_delim_msg;
|
||||
|
||||
struct __db_re_delim_reply {
|
||||
u_int status;
|
||||
};
|
||||
typedef struct __db_re_delim_reply __db_re_delim_reply;
|
||||
|
||||
struct __db_re_len_msg {
|
||||
u_int dbpcl_id;
|
||||
u_int len;
|
||||
};
|
||||
typedef struct __db_re_len_msg __db_re_len_msg;
|
||||
|
||||
struct __db_re_len_reply {
|
||||
u_int status;
|
||||
};
|
||||
typedef struct __db_re_len_reply __db_re_len_reply;
|
||||
|
||||
struct __db_re_pad_msg {
|
||||
u_int dbpcl_id;
|
||||
u_int pad;
|
||||
};
|
||||
typedef struct __db_re_pad_msg __db_re_pad_msg;
|
||||
|
||||
struct __db_re_pad_reply {
|
||||
u_int status;
|
||||
};
|
||||
typedef struct __db_re_pad_reply __db_re_pad_reply;
|
||||
|
||||
struct __db_remove_msg {
|
||||
u_int dbpcl_id;
|
||||
char *name;
|
||||
char *subdb;
|
||||
u_int flags;
|
||||
};
|
||||
typedef struct __db_remove_msg __db_remove_msg;
|
||||
|
||||
struct __db_remove_reply {
|
||||
u_int status;
|
||||
};
|
||||
typedef struct __db_remove_reply __db_remove_reply;
|
||||
|
||||
struct __db_rename_msg {
|
||||
u_int dbpcl_id;
|
||||
char *name;
|
||||
char *subdb;
|
||||
char *newname;
|
||||
u_int flags;
|
||||
};
|
||||
typedef struct __db_rename_msg __db_rename_msg;
|
||||
|
||||
struct __db_rename_reply {
|
||||
u_int status;
|
||||
};
|
||||
typedef struct __db_rename_reply __db_rename_reply;
|
||||
|
||||
struct __db_stat_msg {
|
||||
u_int dbpcl_id;
|
||||
u_int flags;
|
||||
};
|
||||
typedef struct __db_stat_msg __db_stat_msg;
|
||||
|
||||
struct __db_stat_statsreplist {
|
||||
struct {
|
||||
u_int ent_len;
|
||||
char *ent_val;
|
||||
} ent;
|
||||
struct __db_stat_statsreplist *next;
|
||||
};
|
||||
typedef struct __db_stat_statsreplist __db_stat_statsreplist;
|
||||
|
||||
struct __db_stat_reply {
|
||||
u_int status;
|
||||
__db_stat_statsreplist *statslist;
|
||||
};
|
||||
typedef struct __db_stat_reply __db_stat_reply;
|
||||
|
||||
struct __db_swapped_msg {
|
||||
u_int dbpcl_id;
|
||||
};
|
||||
typedef struct __db_swapped_msg __db_swapped_msg;
|
||||
|
||||
struct __db_swapped_reply {
|
||||
u_int status;
|
||||
};
|
||||
typedef struct __db_swapped_reply __db_swapped_reply;
|
||||
|
||||
struct __db_sync_msg {
|
||||
u_int dbpcl_id;
|
||||
u_int flags;
|
||||
};
|
||||
typedef struct __db_sync_msg __db_sync_msg;
|
||||
|
||||
struct __db_sync_reply {
|
||||
u_int status;
|
||||
};
|
||||
typedef struct __db_sync_reply __db_sync_reply;
|
||||
|
||||
struct __db_cursor_msg {
|
||||
u_int dbpcl_id;
|
||||
u_int txnpcl_id;
|
||||
u_int flags;
|
||||
};
|
||||
typedef struct __db_cursor_msg __db_cursor_msg;
|
||||
|
||||
struct __db_cursor_reply {
|
||||
u_int status;
|
||||
u_int dbcidcl_id;
|
||||
};
|
||||
typedef struct __db_cursor_reply __db_cursor_reply;
|
||||
|
||||
struct __db_join_curslist {
|
||||
struct {
|
||||
u_int ent_len;
|
||||
char *ent_val;
|
||||
} ent;
|
||||
struct __db_join_curslist *next;
|
||||
};
|
||||
typedef struct __db_join_curslist __db_join_curslist;
|
||||
|
||||
struct __db_join_msg {
|
||||
u_int dbpcl_id;
|
||||
__db_join_curslist *curslist;
|
||||
u_int flags;
|
||||
};
|
||||
typedef struct __db_join_msg __db_join_msg;
|
||||
|
||||
struct __db_join_reply {
|
||||
u_int status;
|
||||
u_int dbcidcl_id;
|
||||
};
|
||||
typedef struct __db_join_reply __db_join_reply;
|
||||
|
||||
struct __dbc_close_msg {
|
||||
u_int dbccl_id;
|
||||
};
|
||||
typedef struct __dbc_close_msg __dbc_close_msg;
|
||||
|
||||
struct __dbc_close_reply {
|
||||
u_int status;
|
||||
};
|
||||
typedef struct __dbc_close_reply __dbc_close_reply;
|
||||
|
||||
struct __dbc_count_msg {
|
||||
u_int dbccl_id;
|
||||
u_int flags;
|
||||
};
|
||||
typedef struct __dbc_count_msg __dbc_count_msg;
|
||||
|
||||
struct __dbc_count_reply {
|
||||
u_int status;
|
||||
u_int dupcount;
|
||||
};
|
||||
typedef struct __dbc_count_reply __dbc_count_reply;
|
||||
|
||||
struct __dbc_del_msg {
|
||||
u_int dbccl_id;
|
||||
u_int flags;
|
||||
};
|
||||
typedef struct __dbc_del_msg __dbc_del_msg;
|
||||
|
||||
struct __dbc_del_reply {
|
||||
u_int status;
|
||||
};
|
||||
typedef struct __dbc_del_reply __dbc_del_reply;
|
||||
|
||||
struct __dbc_dup_msg {
|
||||
u_int dbccl_id;
|
||||
u_int flags;
|
||||
};
|
||||
typedef struct __dbc_dup_msg __dbc_dup_msg;
|
||||
|
||||
struct __dbc_dup_reply {
|
||||
u_int status;
|
||||
u_int dbcidcl_id;
|
||||
};
|
||||
typedef struct __dbc_dup_reply __dbc_dup_reply;
|
||||
|
||||
struct __dbc_get_msg {
|
||||
u_int dbccl_id;
|
||||
u_int keydlen;
|
||||
u_int keydoff;
|
||||
u_int keyflags;
|
||||
struct {
|
||||
u_int keydata_len;
|
||||
char *keydata_val;
|
||||
} keydata;
|
||||
u_int datadlen;
|
||||
u_int datadoff;
|
||||
u_int dataflags;
|
||||
struct {
|
||||
u_int datadata_len;
|
||||
char *datadata_val;
|
||||
} datadata;
|
||||
u_int flags;
|
||||
};
|
||||
typedef struct __dbc_get_msg __dbc_get_msg;
|
||||
|
||||
struct __dbc_get_reply {
|
||||
u_int status;
|
||||
struct {
|
||||
u_int keydata_len;
|
||||
char *keydata_val;
|
||||
} keydata;
|
||||
struct {
|
||||
u_int datadata_len;
|
||||
char *datadata_val;
|
||||
} datadata;
|
||||
};
|
||||
typedef struct __dbc_get_reply __dbc_get_reply;
|
||||
|
||||
struct __dbc_put_msg {
|
||||
u_int dbccl_id;
|
||||
u_int keydlen;
|
||||
u_int keydoff;
|
||||
u_int keyflags;
|
||||
struct {
|
||||
u_int keydata_len;
|
||||
char *keydata_val;
|
||||
} keydata;
|
||||
u_int datadlen;
|
||||
u_int datadoff;
|
||||
u_int dataflags;
|
||||
struct {
|
||||
u_int datadata_len;
|
||||
char *datadata_val;
|
||||
} datadata;
|
||||
u_int flags;
|
||||
};
|
||||
typedef struct __dbc_put_msg __dbc_put_msg;
|
||||
|
||||
struct __dbc_put_reply {
|
||||
u_int status;
|
||||
struct {
|
||||
u_int keydata_len;
|
||||
char *keydata_val;
|
||||
} keydata;
|
||||
};
|
||||
typedef struct __dbc_put_reply __dbc_put_reply;
|
||||
|
||||
#define DB_SERVERPROG ((unsigned long)(351457))
|
||||
#define DB_SERVERVERS ((unsigned long)(1))
|
||||
#define __DB_env_cachesize ((unsigned long)(1))
|
||||
extern __env_cachesize_reply * __db_env_cachesize_1();
|
||||
#define __DB_env_close ((unsigned long)(2))
|
||||
extern __env_close_reply * __db_env_close_1();
|
||||
#define __DB_env_create ((unsigned long)(3))
|
||||
extern __env_create_reply * __db_env_create_1();
|
||||
#define __DB_env_flags ((unsigned long)(4))
|
||||
extern __env_flags_reply * __db_env_flags_1();
|
||||
#define __DB_env_open ((unsigned long)(5))
|
||||
extern __env_open_reply * __db_env_open_1();
|
||||
#define __DB_env_remove ((unsigned long)(6))
|
||||
extern __env_remove_reply * __db_env_remove_1();
|
||||
#define __DB_txn_abort ((unsigned long)(7))
|
||||
extern __txn_abort_reply * __db_txn_abort_1();
|
||||
#define __DB_txn_begin ((unsigned long)(8))
|
||||
extern __txn_begin_reply * __db_txn_begin_1();
|
||||
#define __DB_txn_commit ((unsigned long)(9))
|
||||
extern __txn_commit_reply * __db_txn_commit_1();
|
||||
#define __DB_db_bt_maxkey ((unsigned long)(10))
|
||||
extern __db_bt_maxkey_reply * __db_db_bt_maxkey_1();
|
||||
#define __DB_db_bt_minkey ((unsigned long)(11))
|
||||
extern __db_bt_minkey_reply * __db_db_bt_minkey_1();
|
||||
#define __DB_db_close ((unsigned long)(12))
|
||||
extern __db_close_reply * __db_db_close_1();
|
||||
#define __DB_db_create ((unsigned long)(13))
|
||||
extern __db_create_reply * __db_db_create_1();
|
||||
#define __DB_db_del ((unsigned long)(14))
|
||||
extern __db_del_reply * __db_db_del_1();
|
||||
#define __DB_db_extentsize ((unsigned long)(15))
|
||||
extern __db_extentsize_reply * __db_db_extentsize_1();
|
||||
#define __DB_db_flags ((unsigned long)(16))
|
||||
extern __db_flags_reply * __db_db_flags_1();
|
||||
#define __DB_db_get ((unsigned long)(17))
|
||||
extern __db_get_reply * __db_db_get_1();
|
||||
#define __DB_db_h_ffactor ((unsigned long)(18))
|
||||
extern __db_h_ffactor_reply * __db_db_h_ffactor_1();
|
||||
#define __DB_db_h_nelem ((unsigned long)(19))
|
||||
extern __db_h_nelem_reply * __db_db_h_nelem_1();
|
||||
#define __DB_db_key_range ((unsigned long)(20))
|
||||
extern __db_key_range_reply * __db_db_key_range_1();
|
||||
#define __DB_db_lorder ((unsigned long)(21))
|
||||
extern __db_lorder_reply * __db_db_lorder_1();
|
||||
#define __DB_db_open ((unsigned long)(22))
|
||||
extern __db_open_reply * __db_db_open_1();
|
||||
#define __DB_db_pagesize ((unsigned long)(23))
|
||||
extern __db_pagesize_reply * __db_db_pagesize_1();
|
||||
#define __DB_db_put ((unsigned long)(24))
|
||||
extern __db_put_reply * __db_db_put_1();
|
||||
#define __DB_db_re_delim ((unsigned long)(25))
|
||||
extern __db_re_delim_reply * __db_db_re_delim_1();
|
||||
#define __DB_db_re_len ((unsigned long)(26))
|
||||
extern __db_re_len_reply * __db_db_re_len_1();
|
||||
#define __DB_db_re_pad ((unsigned long)(27))
|
||||
extern __db_re_pad_reply * __db_db_re_pad_1();
|
||||
#define __DB_db_remove ((unsigned long)(28))
|
||||
extern __db_remove_reply * __db_db_remove_1();
|
||||
#define __DB_db_rename ((unsigned long)(29))
|
||||
extern __db_rename_reply * __db_db_rename_1();
|
||||
#define __DB_db_stat ((unsigned long)(30))
|
||||
extern __db_stat_reply * __db_db_stat_1();
|
||||
#define __DB_db_swapped ((unsigned long)(31))
|
||||
extern __db_swapped_reply * __db_db_swapped_1();
|
||||
#define __DB_db_sync ((unsigned long)(32))
|
||||
extern __db_sync_reply * __db_db_sync_1();
|
||||
#define __DB_db_cursor ((unsigned long)(33))
|
||||
extern __db_cursor_reply * __db_db_cursor_1();
|
||||
#define __DB_db_join ((unsigned long)(34))
|
||||
extern __db_join_reply * __db_db_join_1();
|
||||
#define __DB_dbc_close ((unsigned long)(35))
|
||||
extern __dbc_close_reply * __db_dbc_close_1();
|
||||
#define __DB_dbc_count ((unsigned long)(36))
|
||||
extern __dbc_count_reply * __db_dbc_count_1();
|
||||
#define __DB_dbc_del ((unsigned long)(37))
|
||||
extern __dbc_del_reply * __db_dbc_del_1();
|
||||
#define __DB_dbc_dup ((unsigned long)(38))
|
||||
extern __dbc_dup_reply * __db_dbc_dup_1();
|
||||
#define __DB_dbc_get ((unsigned long)(39))
|
||||
extern __dbc_get_reply * __db_dbc_get_1();
|
||||
#define __DB_dbc_put ((unsigned long)(40))
|
||||
extern __dbc_put_reply * __db_dbc_put_1();
|
||||
extern int db_serverprog_1_freeresult();
|
||||
|
||||
/* the xdr functions */
|
||||
extern bool_t xdr___env_cachesize_msg();
|
||||
extern bool_t xdr___env_cachesize_reply();
|
||||
extern bool_t xdr___env_close_msg();
|
||||
extern bool_t xdr___env_close_reply();
|
||||
extern bool_t xdr___env_create_msg();
|
||||
extern bool_t xdr___env_create_reply();
|
||||
extern bool_t xdr___env_flags_msg();
|
||||
extern bool_t xdr___env_flags_reply();
|
||||
extern bool_t xdr___env_open_msg();
|
||||
extern bool_t xdr___env_open_reply();
|
||||
extern bool_t xdr___env_remove_msg();
|
||||
extern bool_t xdr___env_remove_reply();
|
||||
extern bool_t xdr___txn_abort_msg();
|
||||
extern bool_t xdr___txn_abort_reply();
|
||||
extern bool_t xdr___txn_begin_msg();
|
||||
extern bool_t xdr___txn_begin_reply();
|
||||
extern bool_t xdr___txn_commit_msg();
|
||||
extern bool_t xdr___txn_commit_reply();
|
||||
extern bool_t xdr___db_bt_maxkey_msg();
|
||||
extern bool_t xdr___db_bt_maxkey_reply();
|
||||
extern bool_t xdr___db_bt_minkey_msg();
|
||||
extern bool_t xdr___db_bt_minkey_reply();
|
||||
extern bool_t xdr___db_close_msg();
|
||||
extern bool_t xdr___db_close_reply();
|
||||
extern bool_t xdr___db_create_msg();
|
||||
extern bool_t xdr___db_create_reply();
|
||||
extern bool_t xdr___db_del_msg();
|
||||
extern bool_t xdr___db_del_reply();
|
||||
extern bool_t xdr___db_extentsize_msg();
|
||||
extern bool_t xdr___db_extentsize_reply();
|
||||
extern bool_t xdr___db_flags_msg();
|
||||
extern bool_t xdr___db_flags_reply();
|
||||
extern bool_t xdr___db_get_msg();
|
||||
extern bool_t xdr___db_get_reply();
|
||||
extern bool_t xdr___db_h_ffactor_msg();
|
||||
extern bool_t xdr___db_h_ffactor_reply();
|
||||
extern bool_t xdr___db_h_nelem_msg();
|
||||
extern bool_t xdr___db_h_nelem_reply();
|
||||
extern bool_t xdr___db_key_range_msg();
|
||||
extern bool_t xdr___db_key_range_reply();
|
||||
extern bool_t xdr___db_lorder_msg();
|
||||
extern bool_t xdr___db_lorder_reply();
|
||||
extern bool_t xdr___db_open_msg();
|
||||
extern bool_t xdr___db_open_reply();
|
||||
extern bool_t xdr___db_pagesize_msg();
|
||||
extern bool_t xdr___db_pagesize_reply();
|
||||
extern bool_t xdr___db_put_msg();
|
||||
extern bool_t xdr___db_put_reply();
|
||||
extern bool_t xdr___db_re_delim_msg();
|
||||
extern bool_t xdr___db_re_delim_reply();
|
||||
extern bool_t xdr___db_re_len_msg();
|
||||
extern bool_t xdr___db_re_len_reply();
|
||||
extern bool_t xdr___db_re_pad_msg();
|
||||
extern bool_t xdr___db_re_pad_reply();
|
||||
extern bool_t xdr___db_remove_msg();
|
||||
extern bool_t xdr___db_remove_reply();
|
||||
extern bool_t xdr___db_rename_msg();
|
||||
extern bool_t xdr___db_rename_reply();
|
||||
extern bool_t xdr___db_stat_msg();
|
||||
extern bool_t xdr___db_stat_statsreplist();
|
||||
extern bool_t xdr___db_stat_reply();
|
||||
extern bool_t xdr___db_swapped_msg();
|
||||
extern bool_t xdr___db_swapped_reply();
|
||||
extern bool_t xdr___db_sync_msg();
|
||||
extern bool_t xdr___db_sync_reply();
|
||||
extern bool_t xdr___db_cursor_msg();
|
||||
extern bool_t xdr___db_cursor_reply();
|
||||
extern bool_t xdr___db_join_curslist();
|
||||
extern bool_t xdr___db_join_msg();
|
||||
extern bool_t xdr___db_join_reply();
|
||||
extern bool_t xdr___dbc_close_msg();
|
||||
extern bool_t xdr___dbc_close_reply();
|
||||
extern bool_t xdr___dbc_count_msg();
|
||||
extern bool_t xdr___dbc_count_reply();
|
||||
extern bool_t xdr___dbc_del_msg();
|
||||
extern bool_t xdr___dbc_del_reply();
|
||||
extern bool_t xdr___dbc_dup_msg();
|
||||
extern bool_t xdr___dbc_dup_reply();
|
||||
extern bool_t xdr___dbc_get_msg();
|
||||
extern bool_t xdr___dbc_get_reply();
|
||||
extern bool_t xdr___dbc_put_msg();
|
||||
extern bool_t xdr___dbc_put_reply();
|
||||
|
||||
#endif /* !_DB_SERVER_H_RPCGEN */
|
|
@ -1,248 +0,0 @@
|
|||
/* Do not edit: automatically built by gen_rec.awk. */
|
||||
|
||||
#ifndef ham_AUTO_H
|
||||
#define ham_AUTO_H
|
||||
|
||||
#define DB_ham_insdel 21
|
||||
typedef struct _ham_insdel_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
u_int32_t opcode;
|
||||
int32_t fileid;
|
||||
db_pgno_t pgno;
|
||||
u_int32_t ndx;
|
||||
DB_LSN pagelsn;
|
||||
DBT key;
|
||||
DBT data;
|
||||
} __ham_insdel_args;
|
||||
|
||||
int __ham_insdel_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, int32_t, db_pgno_t, u_int32_t, DB_LSN *, const DBT *, const DBT *));
|
||||
int __ham_insdel_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __ham_insdel_read __P((DB_ENV *, void *, __ham_insdel_args **));
|
||||
|
||||
#define DB_ham_newpage 22
|
||||
typedef struct _ham_newpage_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
u_int32_t opcode;
|
||||
int32_t fileid;
|
||||
db_pgno_t prev_pgno;
|
||||
DB_LSN prevlsn;
|
||||
db_pgno_t new_pgno;
|
||||
DB_LSN pagelsn;
|
||||
db_pgno_t next_pgno;
|
||||
DB_LSN nextlsn;
|
||||
} __ham_newpage_args;
|
||||
|
||||
int __ham_newpage_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *));
|
||||
int __ham_newpage_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __ham_newpage_read __P((DB_ENV *, void *, __ham_newpage_args **));
|
||||
|
||||
#define DB_ham_splitmeta 23
|
||||
typedef struct _ham_splitmeta_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
u_int32_t bucket;
|
||||
u_int32_t ovflpoint;
|
||||
u_int32_t spares;
|
||||
DB_LSN metalsn;
|
||||
} __ham_splitmeta_args;
|
||||
|
||||
int __ham_splitmeta_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __ham_splitmeta_read __P((DB_ENV *, void *, __ham_splitmeta_args **));
|
||||
|
||||
#define DB_ham_splitdata 24
|
||||
typedef struct _ham_splitdata_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
u_int32_t opcode;
|
||||
db_pgno_t pgno;
|
||||
DBT pageimage;
|
||||
DB_LSN pagelsn;
|
||||
} __ham_splitdata_args;
|
||||
|
||||
int __ham_splitdata_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, u_int32_t, db_pgno_t, const DBT *, DB_LSN *));
|
||||
int __ham_splitdata_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __ham_splitdata_read __P((DB_ENV *, void *, __ham_splitdata_args **));
|
||||
|
||||
#define DB_ham_replace 25
|
||||
typedef struct _ham_replace_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
db_pgno_t pgno;
|
||||
u_int32_t ndx;
|
||||
DB_LSN pagelsn;
|
||||
int32_t off;
|
||||
DBT olditem;
|
||||
DBT newitem;
|
||||
u_int32_t makedup;
|
||||
} __ham_replace_args;
|
||||
|
||||
int __ham_replace_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, u_int32_t, DB_LSN *, int32_t, const DBT *, const DBT *, u_int32_t));
|
||||
int __ham_replace_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __ham_replace_read __P((DB_ENV *, void *, __ham_replace_args **));
|
||||
|
||||
#define DB_ham_newpgno 26
|
||||
typedef struct _ham_newpgno_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
u_int32_t opcode;
|
||||
int32_t fileid;
|
||||
db_pgno_t pgno;
|
||||
db_pgno_t free_pgno;
|
||||
u_int32_t old_type;
|
||||
db_pgno_t old_pgno;
|
||||
u_int32_t new_type;
|
||||
DB_LSN pagelsn;
|
||||
DB_LSN metalsn;
|
||||
} __ham_newpgno_args;
|
||||
|
||||
int __ham_newpgno_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __ham_newpgno_read __P((DB_ENV *, void *, __ham_newpgno_args **));
|
||||
|
||||
#define DB_ham_ovfl 27
|
||||
typedef struct _ham_ovfl_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
db_pgno_t start_pgno;
|
||||
u_int32_t npages;
|
||||
db_pgno_t free_pgno;
|
||||
u_int32_t ovflpoint;
|
||||
DB_LSN metalsn;
|
||||
} __ham_ovfl_args;
|
||||
|
||||
int __ham_ovfl_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __ham_ovfl_read __P((DB_ENV *, void *, __ham_ovfl_args **));
|
||||
|
||||
#define DB_ham_copypage 28
|
||||
typedef struct _ham_copypage_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
db_pgno_t pgno;
|
||||
DB_LSN pagelsn;
|
||||
db_pgno_t next_pgno;
|
||||
DB_LSN nextlsn;
|
||||
db_pgno_t nnext_pgno;
|
||||
DB_LSN nnextlsn;
|
||||
DBT page;
|
||||
} __ham_copypage_args;
|
||||
|
||||
int __ham_copypage_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, db_pgno_t, DB_LSN *, const DBT *));
|
||||
int __ham_copypage_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __ham_copypage_read __P((DB_ENV *, void *, __ham_copypage_args **));
|
||||
|
||||
#define DB_ham_metagroup 29
|
||||
typedef struct _ham_metagroup_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
u_int32_t bucket;
|
||||
db_pgno_t pgno;
|
||||
DB_LSN metalsn;
|
||||
DB_LSN pagelsn;
|
||||
} __ham_metagroup_args;
|
||||
|
||||
int __ham_metagroup_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, u_int32_t, db_pgno_t, DB_LSN *, DB_LSN *));
|
||||
int __ham_metagroup_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __ham_metagroup_read __P((DB_ENV *, void *, __ham_metagroup_args **));
|
||||
|
||||
#define DB_ham_groupalloc1 30
|
||||
typedef struct _ham_groupalloc1_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
db_pgno_t pgno;
|
||||
DB_LSN metalsn;
|
||||
DB_LSN mmetalsn;
|
||||
db_pgno_t start_pgno;
|
||||
u_int32_t num;
|
||||
} __ham_groupalloc1_args;
|
||||
|
||||
int __ham_groupalloc1_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __ham_groupalloc1_read __P((DB_ENV *, void *, __ham_groupalloc1_args **));
|
||||
|
||||
#define DB_ham_groupalloc2 31
|
||||
typedef struct _ham_groupalloc2_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
DB_LSN meta_lsn;
|
||||
DB_LSN alloc_lsn;
|
||||
db_pgno_t start_pgno;
|
||||
u_int32_t num;
|
||||
db_pgno_t free;
|
||||
} __ham_groupalloc2_args;
|
||||
|
||||
int __ham_groupalloc2_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __ham_groupalloc2_read __P((DB_ENV *, void *, __ham_groupalloc2_args **));
|
||||
|
||||
#define DB_ham_groupalloc 32
|
||||
typedef struct _ham_groupalloc_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
DB_LSN meta_lsn;
|
||||
db_pgno_t start_pgno;
|
||||
u_int32_t num;
|
||||
db_pgno_t free;
|
||||
} __ham_groupalloc_args;
|
||||
|
||||
int __ham_groupalloc_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, DB_LSN *, db_pgno_t, u_int32_t, db_pgno_t));
|
||||
int __ham_groupalloc_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __ham_groupalloc_read __P((DB_ENV *, void *, __ham_groupalloc_args **));
|
||||
|
||||
#define DB_ham_curadj 33
|
||||
typedef struct _ham_curadj_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
db_pgno_t pgno;
|
||||
u_int32_t indx;
|
||||
u_int32_t len;
|
||||
u_int32_t dup_off;
|
||||
int add;
|
||||
int is_dup;
|
||||
u_int32_t order;
|
||||
} __ham_curadj_args;
|
||||
|
||||
int __ham_curadj_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_pgno_t, u_int32_t, u_int32_t, u_int32_t, int, int, u_int32_t));
|
||||
int __ham_curadj_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __ham_curadj_read __P((DB_ENV *, void *, __ham_curadj_args **));
|
||||
|
||||
#define DB_ham_chgpg 34
|
||||
typedef struct _ham_chgpg_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
db_ham_mode mode;
|
||||
db_pgno_t old_pgno;
|
||||
db_pgno_t new_pgno;
|
||||
u_int32_t old_indx;
|
||||
u_int32_t new_indx;
|
||||
} __ham_chgpg_args;
|
||||
|
||||
int __ham_chgpg_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_ham_mode, db_pgno_t, db_pgno_t, u_int32_t, u_int32_t));
|
||||
int __ham_chgpg_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __ham_chgpg_read __P((DB_ENV *, void *, __ham_chgpg_args **));
|
||||
int __ham_init_print __P((DB_ENV *));
|
||||
int __ham_init_recover __P((DB_ENV *));
|
||||
#endif
|
|
@ -1,39 +0,0 @@
|
|||
/* Do not edit: automatically built by gen_rec.awk. */
|
||||
|
||||
#ifndef log_AUTO_H
|
||||
#define log_AUTO_H
|
||||
|
||||
#define DB_log_register1 1
|
||||
typedef struct _log_register1_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
u_int32_t opcode;
|
||||
DBT name;
|
||||
DBT uid;
|
||||
int32_t fileid;
|
||||
DBTYPE ftype;
|
||||
} __log_register1_args;
|
||||
|
||||
int __log_register1_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __log_register1_read __P((DB_ENV *, void *, __log_register1_args **));
|
||||
|
||||
#define DB_log_register 2
|
||||
typedef struct _log_register_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
u_int32_t opcode;
|
||||
DBT name;
|
||||
DBT uid;
|
||||
int32_t fileid;
|
||||
DBTYPE ftype;
|
||||
db_pgno_t meta_pgno;
|
||||
} __log_register_args;
|
||||
|
||||
int __log_register_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, const DBT *, const DBT *, int32_t, DBTYPE, db_pgno_t));
|
||||
int __log_register_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __log_register_read __P((DB_ENV *, void *, __log_register_args **));
|
||||
int __log_init_print __P((DB_ENV *));
|
||||
int __log_init_recover __P((DB_ENV *));
|
||||
#endif
|
|
@ -1,129 +0,0 @@
|
|||
/* Do not edit: automatically built by gen_rec.awk. */
|
||||
|
||||
#ifndef qam_AUTO_H
|
||||
#define qam_AUTO_H
|
||||
|
||||
#define DB_qam_inc 76
|
||||
typedef struct _qam_inc_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
DB_LSN lsn;
|
||||
} __qam_inc_args;
|
||||
|
||||
int __qam_inc_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, DB_LSN *));
|
||||
int __qam_inc_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __qam_inc_read __P((DB_ENV *, void *, __qam_inc_args **));
|
||||
|
||||
#define DB_qam_incfirst 77
|
||||
typedef struct _qam_incfirst_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
db_recno_t recno;
|
||||
} __qam_incfirst_args;
|
||||
|
||||
int __qam_incfirst_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, db_recno_t));
|
||||
int __qam_incfirst_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __qam_incfirst_read __P((DB_ENV *, void *, __qam_incfirst_args **));
|
||||
|
||||
#define DB_qam_mvptr 78
|
||||
typedef struct _qam_mvptr_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
u_int32_t opcode;
|
||||
int32_t fileid;
|
||||
db_recno_t old_first;
|
||||
db_recno_t new_first;
|
||||
db_recno_t old_cur;
|
||||
db_recno_t new_cur;
|
||||
DB_LSN metalsn;
|
||||
} __qam_mvptr_args;
|
||||
|
||||
int __qam_mvptr_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, int32_t, db_recno_t, db_recno_t, db_recno_t, db_recno_t, DB_LSN *));
|
||||
int __qam_mvptr_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __qam_mvptr_read __P((DB_ENV *, void *, __qam_mvptr_args **));
|
||||
|
||||
#define DB_qam_del 79
|
||||
typedef struct _qam_del_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
DB_LSN lsn;
|
||||
db_pgno_t pgno;
|
||||
u_int32_t indx;
|
||||
db_recno_t recno;
|
||||
} __qam_del_args;
|
||||
|
||||
int __qam_del_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, DB_LSN *, db_pgno_t, u_int32_t, db_recno_t));
|
||||
int __qam_del_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __qam_del_read __P((DB_ENV *, void *, __qam_del_args **));
|
||||
|
||||
#define DB_qam_add 80
|
||||
typedef struct _qam_add_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
DB_LSN lsn;
|
||||
db_pgno_t pgno;
|
||||
u_int32_t indx;
|
||||
db_recno_t recno;
|
||||
DBT data;
|
||||
u_int32_t vflag;
|
||||
DBT olddata;
|
||||
} __qam_add_args;
|
||||
|
||||
int __qam_add_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, DB_LSN *, db_pgno_t, u_int32_t, db_recno_t, const DBT *, u_int32_t, const DBT *));
|
||||
int __qam_add_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __qam_add_read __P((DB_ENV *, void *, __qam_add_args **));
|
||||
|
||||
#define DB_qam_delete 81
|
||||
typedef struct _qam_delete_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
DBT name;
|
||||
DB_LSN lsn;
|
||||
} __qam_delete_args;
|
||||
|
||||
int __qam_delete_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, const DBT *, DB_LSN *));
|
||||
int __qam_delete_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __qam_delete_read __P((DB_ENV *, void *, __qam_delete_args **));
|
||||
|
||||
#define DB_qam_rename 82
|
||||
typedef struct _qam_rename_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
DBT name;
|
||||
DBT newname;
|
||||
} __qam_rename_args;
|
||||
|
||||
int __qam_rename_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, const DBT *, const DBT *));
|
||||
int __qam_rename_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __qam_rename_read __P((DB_ENV *, void *, __qam_rename_args **));
|
||||
|
||||
#define DB_qam_delext 83
|
||||
typedef struct _qam_delext_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
int32_t fileid;
|
||||
DB_LSN lsn;
|
||||
db_pgno_t pgno;
|
||||
u_int32_t indx;
|
||||
db_recno_t recno;
|
||||
DBT data;
|
||||
} __qam_delext_args;
|
||||
|
||||
int __qam_delext_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, int32_t, DB_LSN *, db_pgno_t, u_int32_t, db_recno_t, const DBT *));
|
||||
int __qam_delext_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __qam_delext_read __P((DB_ENV *, void *, __qam_delext_args **));
|
||||
int __qam_init_print __P((DB_ENV *));
|
||||
int __qam_init_recover __P((DB_ENV *));
|
||||
#endif
|
|
@ -1,114 +0,0 @@
|
|||
/* Do not edit: automatically built by gen_rec.awk. */
|
||||
|
||||
#ifndef txn_AUTO_H
|
||||
#define txn_AUTO_H
|
||||
|
||||
#define DB_txn_old_regop 6
|
||||
typedef struct _txn_old_regop_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
u_int32_t opcode;
|
||||
} __txn_old_regop_args;
|
||||
|
||||
int __txn_old_regop_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __txn_old_regop_read __P((DB_ENV *, void *, __txn_old_regop_args **));
|
||||
|
||||
#define DB_txn_regop 10
|
||||
typedef struct _txn_regop_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
u_int32_t opcode;
|
||||
int32_t timestamp;
|
||||
} __txn_regop_args;
|
||||
|
||||
int __txn_regop_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, int32_t));
|
||||
int __txn_regop_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __txn_regop_read __P((DB_ENV *, void *, __txn_regop_args **));
|
||||
|
||||
#define DB_txn_old_ckp 7
|
||||
typedef struct _txn_old_ckp_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
DB_LSN ckp_lsn;
|
||||
DB_LSN last_ckp;
|
||||
} __txn_old_ckp_args;
|
||||
|
||||
int __txn_old_ckp_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __txn_old_ckp_read __P((DB_ENV *, void *, __txn_old_ckp_args **));
|
||||
|
||||
#define DB_txn_ckp 11
|
||||
typedef struct _txn_ckp_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
DB_LSN ckp_lsn;
|
||||
DB_LSN last_ckp;
|
||||
int32_t timestamp;
|
||||
} __txn_ckp_args;
|
||||
|
||||
int __txn_ckp_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, DB_LSN *, DB_LSN *, int32_t));
|
||||
int __txn_ckp_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __txn_ckp_read __P((DB_ENV *, void *, __txn_ckp_args **));
|
||||
|
||||
#define DB_txn_xa_regop_old 8
|
||||
typedef struct _txn_xa_regop_old_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
u_int32_t opcode;
|
||||
DBT xid;
|
||||
int32_t formatID;
|
||||
u_int32_t gtrid;
|
||||
u_int32_t bqual;
|
||||
} __txn_xa_regop_old_args;
|
||||
|
||||
int __txn_xa_regop_old_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __txn_xa_regop_old_read __P((DB_ENV *, void *, __txn_xa_regop_old_args **));
|
||||
|
||||
#define DB_txn_xa_regop 13
|
||||
typedef struct _txn_xa_regop_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
u_int32_t opcode;
|
||||
DBT xid;
|
||||
int32_t formatID;
|
||||
u_int32_t gtrid;
|
||||
u_int32_t bqual;
|
||||
DB_LSN begin_lsn;
|
||||
} __txn_xa_regop_args;
|
||||
|
||||
int __txn_xa_regop_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, const DBT *, int32_t, u_int32_t, u_int32_t, DB_LSN *));
|
||||
int __txn_xa_regop_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __txn_xa_regop_read __P((DB_ENV *, void *, __txn_xa_regop_args **));
|
||||
|
||||
#define DB_txn_child_old 9
|
||||
typedef struct _txn_child_old_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
u_int32_t opcode;
|
||||
u_int32_t parent;
|
||||
} __txn_child_old_args;
|
||||
|
||||
int __txn_child_old_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __txn_child_old_read __P((DB_ENV *, void *, __txn_child_old_args **));
|
||||
|
||||
#define DB_txn_child 12
|
||||
typedef struct _txn_child_args {
|
||||
u_int32_t type;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN prev_lsn;
|
||||
u_int32_t child;
|
||||
DB_LSN c_lsn;
|
||||
} __txn_child_args;
|
||||
|
||||
int __txn_child_log __P((DB_ENV *, DB_TXN *, DB_LSN *, u_int32_t, u_int32_t, DB_LSN *));
|
||||
int __txn_child_print __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
|
||||
int __txn_child_read __P((DB_ENV *, void *, __txn_child_args **));
|
||||
int __txn_init_print __P((DB_ENV *));
|
||||
int __txn_init_recover __P((DB_ENV *));
|
||||
#endif
|
|
@ -1,217 +0,0 @@
|
|||
// DO NOT EDIT: automatically built by dist/s_java.
|
||||
|
||||
package com.sleepycat.db;
|
||||
|
||||
public class DbConstants
|
||||
{
|
||||
public static final int DB_MAX_PAGES = 0xffffffff;
|
||||
public static final int DB_MAX_RECORDS = 0xffffffff;
|
||||
public static final int DB_DBT_ISSET = 0x001;
|
||||
public static final int DB_DBT_MALLOC = 0x002;
|
||||
public static final int DB_DBT_PARTIAL = 0x004;
|
||||
public static final int DB_DBT_REALLOC = 0x008;
|
||||
public static final int DB_DBT_USERMEM = 0x010;
|
||||
public static final int DB_DBT_DUPOK = 0x020;
|
||||
public static final int DB_CREATE = 0x000001;
|
||||
public static final int DB_CXX_NO_EXCEPTIONS = 0x000002;
|
||||
public static final int DB_FORCE = 0x000004;
|
||||
public static final int DB_NOMMAP = 0x000008;
|
||||
public static final int DB_RDONLY = 0x000010;
|
||||
public static final int DB_RECOVER = 0x000020;
|
||||
public static final int DB_THREAD = 0x000040;
|
||||
public static final int DB_TXN_NOSYNC = 0x000080;
|
||||
public static final int DB_USE_ENVIRON = 0x000100;
|
||||
public static final int DB_USE_ENVIRON_ROOT = 0x000200;
|
||||
public static final int DB_CLIENT = 0x000400;
|
||||
public static final int DB_XA_CREATE = 0x000400;
|
||||
public static final int DB_INIT_CDB = 0x000400;
|
||||
public static final int DB_INIT_LOCK = 0x000800;
|
||||
public static final int DB_INIT_LOG = 0x001000;
|
||||
public static final int DB_INIT_MPOOL = 0x002000;
|
||||
public static final int DB_INIT_TXN = 0x004000;
|
||||
public static final int DB_JOINENV = 0x008000;
|
||||
public static final int DB_LOCKDOWN = 0x010000;
|
||||
public static final int DB_PRIVATE = 0x020000;
|
||||
public static final int DB_RECOVER_FATAL = 0x040000;
|
||||
public static final int DB_SYSTEM_MEM = 0x080000;
|
||||
public static final int DB_EXCL = 0x000400;
|
||||
public static final int DB_FCNTL_LOCKING = 0x000800;
|
||||
public static final int DB_ODDFILESIZE = 0x001000;
|
||||
public static final int DB_RDWRMASTER = 0x002000;
|
||||
public static final int DB_TRUNCATE = 0x004000;
|
||||
public static final int DB_EXTENT = 0x008000;
|
||||
public static final int DB_TXN_NOWAIT = 0x000400;
|
||||
public static final int DB_TXN_SYNC = 0x000800;
|
||||
public static final int DB_CDB_ALLDB = 0x000400;
|
||||
public static final int DB_UPGRADE = 0x000400;
|
||||
public static final int DB_VERIFY = 0x000800;
|
||||
public static final int DB_DUP = 0x0001;
|
||||
public static final int DB_DUPSORT = 0x0002;
|
||||
public static final int DB_RECNUM = 0x0004;
|
||||
public static final int DB_RENUMBER = 0x0008;
|
||||
public static final int DB_REVSPLITOFF = 0x0010;
|
||||
public static final int DB_SNAPSHOT = 0x0020;
|
||||
public static final int DB_JOIN_NOSORT = 0x0001;
|
||||
public static final int DB_AGGRESSIVE = 0x0001;
|
||||
public static final int DB_NOORDERCHK = 0x0002;
|
||||
public static final int DB_ORDERCHKONLY = 0x0004;
|
||||
public static final int DB_PR_PAGE = 0x0008;
|
||||
public static final int DB_PR_HEADERS = 0x0010;
|
||||
public static final int DB_PR_RECOVERYTEST = 0x0020;
|
||||
public static final int DB_SALVAGE = 0x0040;
|
||||
public static final int DB_VRFY_FLAGMASK = 0xffff;
|
||||
public static final int DB_LOCK_NORUN = 0;
|
||||
public static final int DB_LOCK_DEFAULT = 1;
|
||||
public static final int DB_LOCK_OLDEST = 2;
|
||||
public static final int DB_LOCK_RANDOM = 3;
|
||||
public static final int DB_LOCK_YOUNGEST = 4;
|
||||
public static final int DB_REGION_MAGIC = 0x120897;
|
||||
public static final int DB_VERB_CHKPOINT = 0x0001;
|
||||
public static final int DB_VERB_DEADLOCK = 0x0002;
|
||||
public static final int DB_VERB_RECOVERY = 0x0004;
|
||||
public static final int DB_VERB_WAITSFOR = 0x0008;
|
||||
public static final int DB_TEST_PREOPEN = 1;
|
||||
public static final int DB_TEST_POSTOPEN = 2;
|
||||
public static final int DB_TEST_POSTLOGMETA = 3;
|
||||
public static final int DB_TEST_POSTLOG = 4;
|
||||
public static final int DB_TEST_POSTSYNC = 5;
|
||||
public static final int DB_TEST_PRERENAME = 6;
|
||||
public static final int DB_TEST_POSTRENAME = 7;
|
||||
public static final int DB_ENV_CDB = 0x00001;
|
||||
public static final int DB_ENV_CDB_ALLDB = 0x00002;
|
||||
public static final int DB_ENV_CREATE = 0x00004;
|
||||
public static final int DB_ENV_DBLOCAL = 0x00008;
|
||||
public static final int DB_ENV_LOCKDOWN = 0x00010;
|
||||
public static final int DB_ENV_NOMMAP = 0x00020;
|
||||
public static final int DB_ENV_OPEN_CALLED = 0x00040;
|
||||
public static final int DB_ENV_PRIVATE = 0x00080;
|
||||
public static final int DB_ENV_RPCCLIENT = 0x00100;
|
||||
public static final int DB_ENV_STANDALONE = 0x00200;
|
||||
public static final int DB_ENV_SYSTEM_MEM = 0x00400;
|
||||
public static final int DB_ENV_THREAD = 0x00800;
|
||||
public static final int DB_ENV_TXN_NOSYNC = 0x01000;
|
||||
public static final int DB_ENV_USER_ALLOC = 0x02000;
|
||||
public static final int DB_BTREEVERSION = 8;
|
||||
public static final int DB_BTREEOLDVER = 6;
|
||||
public static final int DB_BTREEMAGIC = 0x053162;
|
||||
public static final int DB_HASHVERSION = 7;
|
||||
public static final int DB_HASHOLDVER = 4;
|
||||
public static final int DB_HASHMAGIC = 0x061561;
|
||||
public static final int DB_QAMVERSION = 3;
|
||||
public static final int DB_QAMOLDVER = 1;
|
||||
public static final int DB_QAMMAGIC = 0x042253;
|
||||
public static final int DB_LOGVERSION = 3;
|
||||
public static final int DB_LOGOLDVER = 3;
|
||||
public static final int DB_LOGMAGIC = 0x040988;
|
||||
public static final int DB_AFTER = 1;
|
||||
public static final int DB_APPEND = 2;
|
||||
public static final int DB_BEFORE = 3;
|
||||
public static final int DB_CACHED_COUNTS = 4;
|
||||
public static final int DB_CHECKPOINT = 5;
|
||||
public static final int DB_CONSUME = 6;
|
||||
public static final int DB_CONSUME_WAIT = 7;
|
||||
public static final int DB_CURLSN = 8;
|
||||
public static final int DB_CURRENT = 9;
|
||||
public static final int DB_FIRST = 10;
|
||||
public static final int DB_FLUSH = 11;
|
||||
public static final int DB_GET_BOTH = 12;
|
||||
public static final int DB_GET_BOTHC = 13;
|
||||
public static final int DB_GET_RECNO = 14;
|
||||
public static final int DB_JOIN_ITEM = 15;
|
||||
public static final int DB_KEYFIRST = 16;
|
||||
public static final int DB_KEYLAST = 17;
|
||||
public static final int DB_LAST = 18;
|
||||
public static final int DB_NEXT = 19;
|
||||
public static final int DB_NEXT_DUP = 20;
|
||||
public static final int DB_NEXT_NODUP = 21;
|
||||
public static final int DB_NODUPDATA = 22;
|
||||
public static final int DB_NOOVERWRITE = 23;
|
||||
public static final int DB_NOSYNC = 24;
|
||||
public static final int DB_POSITION = 25;
|
||||
public static final int DB_POSITIONI = 26;
|
||||
public static final int DB_PREV = 27;
|
||||
public static final int DB_PREV_NODUP = 28;
|
||||
public static final int DB_RECORDCOUNT = 29;
|
||||
public static final int DB_SET = 30;
|
||||
public static final int DB_SET_RANGE = 31;
|
||||
public static final int DB_SET_RECNO = 32;
|
||||
public static final int DB_WRITECURSOR = 33;
|
||||
public static final int DB_WRITELOCK = 34;
|
||||
public static final int DB_OPFLAGS_MASK = 0x000000ff;
|
||||
public static final int DB_RMW = 0x80000000;
|
||||
public static final int DB_INCOMPLETE = -30999;
|
||||
public static final int DB_KEYEMPTY = -30998;
|
||||
public static final int DB_KEYEXIST = -30997;
|
||||
public static final int DB_LOCK_DEADLOCK = -30996;
|
||||
public static final int DB_LOCK_NOTGRANTED = -30995;
|
||||
public static final int DB_NOSERVER = -30994;
|
||||
public static final int DB_NOSERVER_HOME = -30993;
|
||||
public static final int DB_NOSERVER_ID = -30992;
|
||||
public static final int DB_NOTFOUND = -30991;
|
||||
public static final int DB_OLD_VERSION = -30990;
|
||||
public static final int DB_RUNRECOVERY = -30989;
|
||||
public static final int DB_VERIFY_BAD = -30988;
|
||||
public static final int DB_ALREADY_ABORTED = -30899;
|
||||
public static final int DB_DELETED = -30898;
|
||||
public static final int DB_JAVA_CALLBACK = -30897;
|
||||
public static final int DB_NEEDSPLIT = -30896;
|
||||
public static final int DB_SWAPBYTES = -30895;
|
||||
public static final int DB_TXN_CKP = -30894;
|
||||
public static final int DB_VERIFY_FATAL = -30893;
|
||||
public static final int DB_FILE_ID_LEN = 20;
|
||||
public static final int DB_LOGFILEID_INVALID = -1;
|
||||
public static final int DB_OK_BTREE = 0x01;
|
||||
public static final int DB_OK_HASH = 0x02;
|
||||
public static final int DB_OK_QUEUE = 0x04;
|
||||
public static final int DB_OK_RECNO = 0x08;
|
||||
public static final int DB_AM_DISCARD = 0x00001;
|
||||
public static final int DB_AM_DUP = 0x00002;
|
||||
public static final int DB_AM_DUPSORT = 0x00004;
|
||||
public static final int DB_AM_INMEM = 0x00008;
|
||||
public static final int DB_AM_PGDEF = 0x00010;
|
||||
public static final int DB_AM_RDONLY = 0x00020;
|
||||
public static final int DB_AM_RECOVER = 0x00040;
|
||||
public static final int DB_AM_SUBDB = 0x00080;
|
||||
public static final int DB_AM_SWAP = 0x00100;
|
||||
public static final int DB_AM_TXN = 0x00200;
|
||||
public static final int DB_AM_VERIFYING = 0x00400;
|
||||
public static final int DB_BT_RECNUM = 0x00800;
|
||||
public static final int DB_BT_REVSPLIT = 0x01000;
|
||||
public static final int DB_DBM_ERROR = 0x02000;
|
||||
public static final int DB_OPEN_CALLED = 0x04000;
|
||||
public static final int DB_RE_DELIMITER = 0x08000;
|
||||
public static final int DB_RE_FIXEDLEN = 0x10000;
|
||||
public static final int DB_RE_PAD = 0x20000;
|
||||
public static final int DB_RE_RENUMBER = 0x40000;
|
||||
public static final int DB_RE_SNAPSHOT = 0x80000;
|
||||
public static final int DB_RECORD_LOCK = 1;
|
||||
public static final int DB_PAGE_LOCK = 2;
|
||||
public static final int DB_LOCKVERSION = 1;
|
||||
public static final int DB_LOCK_NOWAIT = 0x01;
|
||||
public static final int DB_LOCK_RECORD = 0x02;
|
||||
public static final int DB_LOCK_UPGRADE = 0x04;
|
||||
public static final int DB_LOCK_SWITCH = 0x08;
|
||||
public static final int DB_LOCK_CONFLICT = 0x01;
|
||||
public static final int DB_LOCK_RIW_N = 7;
|
||||
public static final int DB_ARCH_ABS = 0x001;
|
||||
public static final int DB_ARCH_DATA = 0x002;
|
||||
public static final int DB_ARCH_LOG = 0x004;
|
||||
public static final int DB_MPOOL_CREATE = 0x001;
|
||||
public static final int DB_MPOOL_LAST = 0x002;
|
||||
public static final int DB_MPOOL_NEW = 0x004;
|
||||
public static final int DB_MPOOL_NEW_GROUP = 0x008;
|
||||
public static final int DB_MPOOL_EXTENT = 0x010;
|
||||
public static final int DB_MPOOL_CLEAN = 0x001;
|
||||
public static final int DB_MPOOL_DIRTY = 0x002;
|
||||
public static final int DB_MPOOL_DISCARD = 0x004;
|
||||
public static final int DB_TXNVERSION = 1;
|
||||
public static final int DB_TXN_BACKWARD_ROLL = 1;
|
||||
public static final int DB_TXN_FORWARD_ROLL = 2;
|
||||
public static final int DB_TXN_OPENFILES = 3;
|
||||
public static final int DB_TXN_REDO = 4;
|
||||
public static final int DB_TXN_UNDO = 5;
|
||||
public static final int DB_DBM_HSEARCH = 0;
|
||||
public static final int DB_VERSION_MAJOR = 3;
|
||||
public static final int DB_VERSION_MINOR = 2;
|
||||
public static final int DB_VERSION_PATCH = 9;
|
||||
}
|
|
@ -1,326 +0,0 @@
|
|||
/* Do not edit: automatically built by gen_rec.awk. */
|
||||
#include "db_config.h"
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#include "db_int.h"
|
||||
#include "db_page.h"
|
||||
#include "db_dispatch.h"
|
||||
#include "db_am.h"
|
||||
#include "log.h"
|
||||
#include "txn.h"
|
||||
|
||||
int
|
||||
__log_register1_print(dbenv, dbtp, lsnp, notused2, notused3)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops notused2;
|
||||
void *notused3;
|
||||
{
|
||||
__log_register1_args *argp;
|
||||
u_int32_t i;
|
||||
u_int ch;
|
||||
int ret;
|
||||
|
||||
i = 0;
|
||||
ch = 0;
|
||||
notused2 = DB_TXN_ABORT;
|
||||
notused3 = NULL;
|
||||
|
||||
if ((ret = __log_register1_read(dbenv, dbtp->data, &argp)) != 0)
|
||||
return (ret);
|
||||
printf("[%lu][%lu]log_register1: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
|
||||
(u_long)lsnp->file,
|
||||
(u_long)lsnp->offset,
|
||||
(u_long)argp->type,
|
||||
(u_long)argp->txnid->txnid,
|
||||
(u_long)argp->prev_lsn.file,
|
||||
(u_long)argp->prev_lsn.offset);
|
||||
printf("\topcode: %lu\n", (u_long)argp->opcode);
|
||||
printf("\tname: ");
|
||||
for (i = 0; i < argp->name.size; i++) {
|
||||
ch = ((u_int8_t *)argp->name.data)[i];
|
||||
if (isprint(ch) || ch == 0xa)
|
||||
putchar(ch);
|
||||
else
|
||||
printf("%#x ", ch);
|
||||
}
|
||||
printf("\n");
|
||||
printf("\tuid: ");
|
||||
for (i = 0; i < argp->uid.size; i++) {
|
||||
ch = ((u_int8_t *)argp->uid.data)[i];
|
||||
if (isprint(ch) || ch == 0xa)
|
||||
putchar(ch);
|
||||
else
|
||||
printf("%#x ", ch);
|
||||
}
|
||||
printf("\n");
|
||||
printf("\tfileid: %ld\n", (long)argp->fileid);
|
||||
printf("\tftype: 0x%lx\n", (u_long)argp->ftype);
|
||||
printf("\n");
|
||||
__os_free(argp, 0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__log_register1_read(dbenv, recbuf, argpp)
|
||||
DB_ENV *dbenv;
|
||||
void *recbuf;
|
||||
__log_register1_args **argpp;
|
||||
{
|
||||
__log_register1_args *argp;
|
||||
u_int8_t *bp;
|
||||
int ret;
|
||||
|
||||
ret = __os_malloc(dbenv, sizeof(__log_register1_args) +
|
||||
sizeof(DB_TXN), NULL, &argp);
|
||||
if (ret != 0)
|
||||
return (ret);
|
||||
argp->txnid = (DB_TXN *)&argp[1];
|
||||
bp = recbuf;
|
||||
memcpy(&argp->type, bp, sizeof(argp->type));
|
||||
bp += sizeof(argp->type);
|
||||
memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid));
|
||||
bp += sizeof(argp->txnid->txnid);
|
||||
memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
|
||||
bp += sizeof(DB_LSN);
|
||||
memcpy(&argp->opcode, bp, sizeof(argp->opcode));
|
||||
bp += sizeof(argp->opcode);
|
||||
memset(&argp->name, 0, sizeof(argp->name));
|
||||
memcpy(&argp->name.size, bp, sizeof(u_int32_t));
|
||||
bp += sizeof(u_int32_t);
|
||||
argp->name.data = bp;
|
||||
bp += argp->name.size;
|
||||
memset(&argp->uid, 0, sizeof(argp->uid));
|
||||
memcpy(&argp->uid.size, bp, sizeof(u_int32_t));
|
||||
bp += sizeof(u_int32_t);
|
||||
argp->uid.data = bp;
|
||||
bp += argp->uid.size;
|
||||
memcpy(&argp->fileid, bp, sizeof(argp->fileid));
|
||||
bp += sizeof(argp->fileid);
|
||||
memcpy(&argp->ftype, bp, sizeof(argp->ftype));
|
||||
bp += sizeof(argp->ftype);
|
||||
*argpp = argp;
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__log_register_log(dbenv, txnid, ret_lsnp, flags,
|
||||
opcode, name, uid, fileid, ftype, meta_pgno)
|
||||
DB_ENV *dbenv;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN *ret_lsnp;
|
||||
u_int32_t flags;
|
||||
u_int32_t opcode;
|
||||
const DBT *name;
|
||||
const DBT *uid;
|
||||
int32_t fileid;
|
||||
DBTYPE ftype;
|
||||
db_pgno_t meta_pgno;
|
||||
{
|
||||
DBT logrec;
|
||||
DB_LSN *lsnp, null_lsn;
|
||||
u_int32_t zero;
|
||||
u_int32_t rectype, txn_num;
|
||||
int ret;
|
||||
u_int8_t *bp;
|
||||
|
||||
rectype = DB_log_register;
|
||||
if (txnid != NULL &&
|
||||
TAILQ_FIRST(&txnid->kids) != NULL &&
|
||||
(ret = __txn_activekids(dbenv, rectype, txnid)) != 0)
|
||||
return (ret);
|
||||
txn_num = txnid == NULL ? 0 : txnid->txnid;
|
||||
if (txnid == NULL) {
|
||||
ZERO_LSN(null_lsn);
|
||||
lsnp = &null_lsn;
|
||||
} else
|
||||
lsnp = &txnid->last_lsn;
|
||||
logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
|
||||
+ sizeof(opcode)
|
||||
+ sizeof(u_int32_t) + (name == NULL ? 0 : name->size)
|
||||
+ sizeof(u_int32_t) + (uid == NULL ? 0 : uid->size)
|
||||
+ sizeof(fileid)
|
||||
+ sizeof(ftype)
|
||||
+ sizeof(meta_pgno);
|
||||
if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0)
|
||||
return (ret);
|
||||
|
||||
bp = logrec.data;
|
||||
memcpy(bp, &rectype, sizeof(rectype));
|
||||
bp += sizeof(rectype);
|
||||
memcpy(bp, &txn_num, sizeof(txn_num));
|
||||
bp += sizeof(txn_num);
|
||||
memcpy(bp, lsnp, sizeof(DB_LSN));
|
||||
bp += sizeof(DB_LSN);
|
||||
memcpy(bp, &opcode, sizeof(opcode));
|
||||
bp += sizeof(opcode);
|
||||
if (name == NULL) {
|
||||
zero = 0;
|
||||
memcpy(bp, &zero, sizeof(u_int32_t));
|
||||
bp += sizeof(u_int32_t);
|
||||
} else {
|
||||
memcpy(bp, &name->size, sizeof(name->size));
|
||||
bp += sizeof(name->size);
|
||||
memcpy(bp, name->data, name->size);
|
||||
bp += name->size;
|
||||
}
|
||||
if (uid == NULL) {
|
||||
zero = 0;
|
||||
memcpy(bp, &zero, sizeof(u_int32_t));
|
||||
bp += sizeof(u_int32_t);
|
||||
} else {
|
||||
memcpy(bp, &uid->size, sizeof(uid->size));
|
||||
bp += sizeof(uid->size);
|
||||
memcpy(bp, uid->data, uid->size);
|
||||
bp += uid->size;
|
||||
}
|
||||
memcpy(bp, &fileid, sizeof(fileid));
|
||||
bp += sizeof(fileid);
|
||||
memcpy(bp, &ftype, sizeof(ftype));
|
||||
bp += sizeof(ftype);
|
||||
memcpy(bp, &meta_pgno, sizeof(meta_pgno));
|
||||
bp += sizeof(meta_pgno);
|
||||
DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size);
|
||||
ret = __log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags);
|
||||
if (txnid != NULL)
|
||||
txnid->last_lsn = *ret_lsnp;
|
||||
__os_free(logrec.data, logrec.size);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
int
|
||||
__log_register_print(dbenv, dbtp, lsnp, notused2, notused3)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops notused2;
|
||||
void *notused3;
|
||||
{
|
||||
__log_register_args *argp;
|
||||
u_int32_t i;
|
||||
u_int ch;
|
||||
int ret;
|
||||
|
||||
i = 0;
|
||||
ch = 0;
|
||||
notused2 = DB_TXN_ABORT;
|
||||
notused3 = NULL;
|
||||
|
||||
if ((ret = __log_register_read(dbenv, dbtp->data, &argp)) != 0)
|
||||
return (ret);
|
||||
printf("[%lu][%lu]log_register: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
|
||||
(u_long)lsnp->file,
|
||||
(u_long)lsnp->offset,
|
||||
(u_long)argp->type,
|
||||
(u_long)argp->txnid->txnid,
|
||||
(u_long)argp->prev_lsn.file,
|
||||
(u_long)argp->prev_lsn.offset);
|
||||
printf("\topcode: %lu\n", (u_long)argp->opcode);
|
||||
printf("\tname: ");
|
||||
for (i = 0; i < argp->name.size; i++) {
|
||||
ch = ((u_int8_t *)argp->name.data)[i];
|
||||
if (isprint(ch) || ch == 0xa)
|
||||
putchar(ch);
|
||||
else
|
||||
printf("%#x ", ch);
|
||||
}
|
||||
printf("\n");
|
||||
printf("\tuid: ");
|
||||
for (i = 0; i < argp->uid.size; i++) {
|
||||
ch = ((u_int8_t *)argp->uid.data)[i];
|
||||
if (isprint(ch) || ch == 0xa)
|
||||
putchar(ch);
|
||||
else
|
||||
printf("%#x ", ch);
|
||||
}
|
||||
printf("\n");
|
||||
printf("\tfileid: %ld\n", (long)argp->fileid);
|
||||
printf("\tftype: 0x%lx\n", (u_long)argp->ftype);
|
||||
printf("\tmeta_pgno: %lu\n", (u_long)argp->meta_pgno);
|
||||
printf("\n");
|
||||
__os_free(argp, 0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__log_register_read(dbenv, recbuf, argpp)
|
||||
DB_ENV *dbenv;
|
||||
void *recbuf;
|
||||
__log_register_args **argpp;
|
||||
{
|
||||
__log_register_args *argp;
|
||||
u_int8_t *bp;
|
||||
int ret;
|
||||
|
||||
ret = __os_malloc(dbenv, sizeof(__log_register_args) +
|
||||
sizeof(DB_TXN), NULL, &argp);
|
||||
if (ret != 0)
|
||||
return (ret);
|
||||
argp->txnid = (DB_TXN *)&argp[1];
|
||||
bp = recbuf;
|
||||
memcpy(&argp->type, bp, sizeof(argp->type));
|
||||
bp += sizeof(argp->type);
|
||||
memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid));
|
||||
bp += sizeof(argp->txnid->txnid);
|
||||
memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
|
||||
bp += sizeof(DB_LSN);
|
||||
memcpy(&argp->opcode, bp, sizeof(argp->opcode));
|
||||
bp += sizeof(argp->opcode);
|
||||
memset(&argp->name, 0, sizeof(argp->name));
|
||||
memcpy(&argp->name.size, bp, sizeof(u_int32_t));
|
||||
bp += sizeof(u_int32_t);
|
||||
argp->name.data = bp;
|
||||
bp += argp->name.size;
|
||||
memset(&argp->uid, 0, sizeof(argp->uid));
|
||||
memcpy(&argp->uid.size, bp, sizeof(u_int32_t));
|
||||
bp += sizeof(u_int32_t);
|
||||
argp->uid.data = bp;
|
||||
bp += argp->uid.size;
|
||||
memcpy(&argp->fileid, bp, sizeof(argp->fileid));
|
||||
bp += sizeof(argp->fileid);
|
||||
memcpy(&argp->ftype, bp, sizeof(argp->ftype));
|
||||
bp += sizeof(argp->ftype);
|
||||
memcpy(&argp->meta_pgno, bp, sizeof(argp->meta_pgno));
|
||||
bp += sizeof(argp->meta_pgno);
|
||||
*argpp = argp;
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__log_init_print(dbenv)
|
||||
DB_ENV *dbenv;
|
||||
{
|
||||
int ret;
|
||||
|
||||
if ((ret = __db_add_recovery(dbenv,
|
||||
__log_register1_print, DB_log_register1)) != 0)
|
||||
return (ret);
|
||||
if ((ret = __db_add_recovery(dbenv,
|
||||
__log_register_print, DB_log_register)) != 0)
|
||||
return (ret);
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__log_init_recover(dbenv)
|
||||
DB_ENV *dbenv;
|
||||
{
|
||||
int ret;
|
||||
|
||||
if ((ret = __db_add_recovery(dbenv,
|
||||
__deprecated_recover, DB_log_register1)) != 0)
|
||||
return (ret);
|
||||
if ((ret = __db_add_recovery(dbenv,
|
||||
__log_register_recover, DB_log_register)) != 0)
|
||||
return (ret);
|
||||
return (0);
|
||||
}
|
||||
|
1282
bdb/qam/qam_auto.c
1282
bdb/qam/qam_auto.c
File diff suppressed because it is too large
Load diff
|
@ -1,692 +0,0 @@
|
|||
#include "db_config.h"
|
||||
#ifdef HAVE_RPC
|
||||
/*
|
||||
* Please do not edit this file.
|
||||
* It was generated using rpcgen.
|
||||
*/
|
||||
|
||||
#include "db_server.h"
|
||||
|
||||
/* Default timeout can be changed using clnt_control() */
|
||||
static struct timeval TIMEOUT = { 25, 0 };
|
||||
|
||||
__env_cachesize_reply *
|
||||
__db_env_cachesize_1(argp, clnt)
|
||||
__env_cachesize_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __env_cachesize_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_env_cachesize,
|
||||
(xdrproc_t) xdr___env_cachesize_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___env_cachesize_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__env_close_reply *
|
||||
__db_env_close_1(argp, clnt)
|
||||
__env_close_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __env_close_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_env_close,
|
||||
(xdrproc_t) xdr___env_close_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___env_close_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__env_create_reply *
|
||||
__db_env_create_1(argp, clnt)
|
||||
__env_create_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __env_create_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_env_create,
|
||||
(xdrproc_t) xdr___env_create_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___env_create_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__env_flags_reply *
|
||||
__db_env_flags_1(argp, clnt)
|
||||
__env_flags_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __env_flags_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_env_flags,
|
||||
(xdrproc_t) xdr___env_flags_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___env_flags_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__env_open_reply *
|
||||
__db_env_open_1(argp, clnt)
|
||||
__env_open_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __env_open_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_env_open,
|
||||
(xdrproc_t) xdr___env_open_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___env_open_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__env_remove_reply *
|
||||
__db_env_remove_1(argp, clnt)
|
||||
__env_remove_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __env_remove_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_env_remove,
|
||||
(xdrproc_t) xdr___env_remove_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___env_remove_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__txn_abort_reply *
|
||||
__db_txn_abort_1(argp, clnt)
|
||||
__txn_abort_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __txn_abort_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_txn_abort,
|
||||
(xdrproc_t) xdr___txn_abort_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___txn_abort_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__txn_begin_reply *
|
||||
__db_txn_begin_1(argp, clnt)
|
||||
__txn_begin_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __txn_begin_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_txn_begin,
|
||||
(xdrproc_t) xdr___txn_begin_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___txn_begin_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__txn_commit_reply *
|
||||
__db_txn_commit_1(argp, clnt)
|
||||
__txn_commit_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __txn_commit_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_txn_commit,
|
||||
(xdrproc_t) xdr___txn_commit_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___txn_commit_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__db_bt_maxkey_reply *
|
||||
__db_db_bt_maxkey_1(argp, clnt)
|
||||
__db_bt_maxkey_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __db_bt_maxkey_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_db_bt_maxkey,
|
||||
(xdrproc_t) xdr___db_bt_maxkey_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___db_bt_maxkey_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__db_bt_minkey_reply *
|
||||
__db_db_bt_minkey_1(argp, clnt)
|
||||
__db_bt_minkey_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __db_bt_minkey_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_db_bt_minkey,
|
||||
(xdrproc_t) xdr___db_bt_minkey_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___db_bt_minkey_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__db_close_reply *
|
||||
__db_db_close_1(argp, clnt)
|
||||
__db_close_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __db_close_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_db_close,
|
||||
(xdrproc_t) xdr___db_close_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___db_close_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__db_create_reply *
|
||||
__db_db_create_1(argp, clnt)
|
||||
__db_create_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __db_create_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_db_create,
|
||||
(xdrproc_t) xdr___db_create_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___db_create_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__db_del_reply *
|
||||
__db_db_del_1(argp, clnt)
|
||||
__db_del_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __db_del_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_db_del,
|
||||
(xdrproc_t) xdr___db_del_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___db_del_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__db_extentsize_reply *
|
||||
__db_db_extentsize_1(argp, clnt)
|
||||
__db_extentsize_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __db_extentsize_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_db_extentsize,
|
||||
(xdrproc_t) xdr___db_extentsize_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___db_extentsize_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__db_flags_reply *
|
||||
__db_db_flags_1(argp, clnt)
|
||||
__db_flags_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __db_flags_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_db_flags,
|
||||
(xdrproc_t) xdr___db_flags_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___db_flags_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__db_get_reply *
|
||||
__db_db_get_1(argp, clnt)
|
||||
__db_get_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __db_get_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_db_get,
|
||||
(xdrproc_t) xdr___db_get_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___db_get_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__db_h_ffactor_reply *
|
||||
__db_db_h_ffactor_1(argp, clnt)
|
||||
__db_h_ffactor_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __db_h_ffactor_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_db_h_ffactor,
|
||||
(xdrproc_t) xdr___db_h_ffactor_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___db_h_ffactor_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__db_h_nelem_reply *
|
||||
__db_db_h_nelem_1(argp, clnt)
|
||||
__db_h_nelem_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __db_h_nelem_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_db_h_nelem,
|
||||
(xdrproc_t) xdr___db_h_nelem_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___db_h_nelem_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__db_key_range_reply *
|
||||
__db_db_key_range_1(argp, clnt)
|
||||
__db_key_range_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __db_key_range_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_db_key_range,
|
||||
(xdrproc_t) xdr___db_key_range_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___db_key_range_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__db_lorder_reply *
|
||||
__db_db_lorder_1(argp, clnt)
|
||||
__db_lorder_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __db_lorder_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_db_lorder,
|
||||
(xdrproc_t) xdr___db_lorder_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___db_lorder_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__db_open_reply *
|
||||
__db_db_open_1(argp, clnt)
|
||||
__db_open_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __db_open_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_db_open,
|
||||
(xdrproc_t) xdr___db_open_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___db_open_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__db_pagesize_reply *
|
||||
__db_db_pagesize_1(argp, clnt)
|
||||
__db_pagesize_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __db_pagesize_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_db_pagesize,
|
||||
(xdrproc_t) xdr___db_pagesize_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___db_pagesize_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__db_put_reply *
|
||||
__db_db_put_1(argp, clnt)
|
||||
__db_put_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __db_put_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_db_put,
|
||||
(xdrproc_t) xdr___db_put_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___db_put_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__db_re_delim_reply *
|
||||
__db_db_re_delim_1(argp, clnt)
|
||||
__db_re_delim_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __db_re_delim_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_db_re_delim,
|
||||
(xdrproc_t) xdr___db_re_delim_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___db_re_delim_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__db_re_len_reply *
|
||||
__db_db_re_len_1(argp, clnt)
|
||||
__db_re_len_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __db_re_len_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_db_re_len,
|
||||
(xdrproc_t) xdr___db_re_len_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___db_re_len_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__db_re_pad_reply *
|
||||
__db_db_re_pad_1(argp, clnt)
|
||||
__db_re_pad_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __db_re_pad_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_db_re_pad,
|
||||
(xdrproc_t) xdr___db_re_pad_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___db_re_pad_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__db_remove_reply *
|
||||
__db_db_remove_1(argp, clnt)
|
||||
__db_remove_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __db_remove_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_db_remove,
|
||||
(xdrproc_t) xdr___db_remove_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___db_remove_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__db_rename_reply *
|
||||
__db_db_rename_1(argp, clnt)
|
||||
__db_rename_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __db_rename_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_db_rename,
|
||||
(xdrproc_t) xdr___db_rename_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___db_rename_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__db_stat_reply *
|
||||
__db_db_stat_1(argp, clnt)
|
||||
__db_stat_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __db_stat_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_db_stat,
|
||||
(xdrproc_t) xdr___db_stat_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___db_stat_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__db_swapped_reply *
|
||||
__db_db_swapped_1(argp, clnt)
|
||||
__db_swapped_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __db_swapped_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_db_swapped,
|
||||
(xdrproc_t) xdr___db_swapped_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___db_swapped_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__db_sync_reply *
|
||||
__db_db_sync_1(argp, clnt)
|
||||
__db_sync_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __db_sync_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_db_sync,
|
||||
(xdrproc_t) xdr___db_sync_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___db_sync_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__db_cursor_reply *
|
||||
__db_db_cursor_1(argp, clnt)
|
||||
__db_cursor_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __db_cursor_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_db_cursor,
|
||||
(xdrproc_t) xdr___db_cursor_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___db_cursor_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__db_join_reply *
|
||||
__db_db_join_1(argp, clnt)
|
||||
__db_join_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __db_join_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_db_join,
|
||||
(xdrproc_t) xdr___db_join_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___db_join_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__dbc_close_reply *
|
||||
__db_dbc_close_1(argp, clnt)
|
||||
__dbc_close_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __dbc_close_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_dbc_close,
|
||||
(xdrproc_t) xdr___dbc_close_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___dbc_close_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__dbc_count_reply *
|
||||
__db_dbc_count_1(argp, clnt)
|
||||
__dbc_count_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __dbc_count_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_dbc_count,
|
||||
(xdrproc_t) xdr___dbc_count_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___dbc_count_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__dbc_del_reply *
|
||||
__db_dbc_del_1(argp, clnt)
|
||||
__dbc_del_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __dbc_del_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_dbc_del,
|
||||
(xdrproc_t) xdr___dbc_del_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___dbc_del_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__dbc_dup_reply *
|
||||
__db_dbc_dup_1(argp, clnt)
|
||||
__dbc_dup_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __dbc_dup_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_dbc_dup,
|
||||
(xdrproc_t) xdr___dbc_dup_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___dbc_dup_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__dbc_get_reply *
|
||||
__db_dbc_get_1(argp, clnt)
|
||||
__dbc_get_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __dbc_get_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_dbc_get,
|
||||
(xdrproc_t) xdr___dbc_get_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___dbc_get_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
|
||||
__dbc_put_reply *
|
||||
__db_dbc_put_1(argp, clnt)
|
||||
__dbc_put_msg *argp;
|
||||
CLIENT *clnt;
|
||||
{
|
||||
static __dbc_put_reply clnt_res;
|
||||
|
||||
memset((char *)&clnt_res, 0, sizeof (clnt_res));
|
||||
if (clnt_call(clnt, __DB_dbc_put,
|
||||
(xdrproc_t) xdr___dbc_put_msg, (caddr_t) argp,
|
||||
(xdrproc_t) xdr___dbc_put_reply, (caddr_t) &clnt_res,
|
||||
TIMEOUT) != RPC_SUCCESS) {
|
||||
return (NULL);
|
||||
}
|
||||
return (&clnt_res);
|
||||
}
|
||||
#endif /* HAVE_RPC */
|
File diff suppressed because it is too large
Load diff
|
@ -1,359 +0,0 @@
|
|||
#include "db_config.h"
|
||||
#ifdef HAVE_RPC
|
||||
/*
|
||||
* Please do not edit this file.
|
||||
* It was generated using rpcgen.
|
||||
*/
|
||||
|
||||
#include "db_server.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h> /* getenv, exit */
|
||||
#include <memory.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
extern void __dbsrv_timeout();
|
||||
|
||||
#ifdef DEBUG
|
||||
#define RPC_SVC_FG
|
||||
#endif
|
||||
|
||||
static void
|
||||
db_serverprog_1(rqstp, transp)
|
||||
struct svc_req *rqstp;
|
||||
register SVCXPRT *transp;
|
||||
{
|
||||
union {
|
||||
__env_cachesize_msg __db_env_cachesize_1_arg;
|
||||
__env_close_msg __db_env_close_1_arg;
|
||||
__env_create_msg __db_env_create_1_arg;
|
||||
__env_flags_msg __db_env_flags_1_arg;
|
||||
__env_open_msg __db_env_open_1_arg;
|
||||
__env_remove_msg __db_env_remove_1_arg;
|
||||
__txn_abort_msg __db_txn_abort_1_arg;
|
||||
__txn_begin_msg __db_txn_begin_1_arg;
|
||||
__txn_commit_msg __db_txn_commit_1_arg;
|
||||
__db_bt_maxkey_msg __db_db_bt_maxkey_1_arg;
|
||||
__db_bt_minkey_msg __db_db_bt_minkey_1_arg;
|
||||
__db_close_msg __db_db_close_1_arg;
|
||||
__db_create_msg __db_db_create_1_arg;
|
||||
__db_del_msg __db_db_del_1_arg;
|
||||
__db_extentsize_msg __db_db_extentsize_1_arg;
|
||||
__db_flags_msg __db_db_flags_1_arg;
|
||||
__db_get_msg __db_db_get_1_arg;
|
||||
__db_h_ffactor_msg __db_db_h_ffactor_1_arg;
|
||||
__db_h_nelem_msg __db_db_h_nelem_1_arg;
|
||||
__db_key_range_msg __db_db_key_range_1_arg;
|
||||
__db_lorder_msg __db_db_lorder_1_arg;
|
||||
__db_open_msg __db_db_open_1_arg;
|
||||
__db_pagesize_msg __db_db_pagesize_1_arg;
|
||||
__db_put_msg __db_db_put_1_arg;
|
||||
__db_re_delim_msg __db_db_re_delim_1_arg;
|
||||
__db_re_len_msg __db_db_re_len_1_arg;
|
||||
__db_re_pad_msg __db_db_re_pad_1_arg;
|
||||
__db_remove_msg __db_db_remove_1_arg;
|
||||
__db_rename_msg __db_db_rename_1_arg;
|
||||
__db_stat_msg __db_db_stat_1_arg;
|
||||
__db_swapped_msg __db_db_swapped_1_arg;
|
||||
__db_sync_msg __db_db_sync_1_arg;
|
||||
__db_cursor_msg __db_db_cursor_1_arg;
|
||||
__db_join_msg __db_db_join_1_arg;
|
||||
__dbc_close_msg __db_dbc_close_1_arg;
|
||||
__dbc_count_msg __db_dbc_count_1_arg;
|
||||
__dbc_del_msg __db_dbc_del_1_arg;
|
||||
__dbc_dup_msg __db_dbc_dup_1_arg;
|
||||
__dbc_get_msg __db_dbc_get_1_arg;
|
||||
__dbc_put_msg __db_dbc_put_1_arg;
|
||||
} argument;
|
||||
char *result;
|
||||
bool_t (*xdr_argument)(), (*xdr_result)();
|
||||
char *(*local)();
|
||||
|
||||
switch (rqstp->rq_proc) {
|
||||
case NULLPROC:
|
||||
(void) svc_sendreply(transp, xdr_void,
|
||||
(char *)NULL);
|
||||
return;
|
||||
|
||||
case __DB_env_cachesize:
|
||||
xdr_argument = xdr___env_cachesize_msg;
|
||||
xdr_result = xdr___env_cachesize_reply;
|
||||
local = (char *(*)()) __db_env_cachesize_1;
|
||||
break;
|
||||
|
||||
case __DB_env_close:
|
||||
xdr_argument = xdr___env_close_msg;
|
||||
xdr_result = xdr___env_close_reply;
|
||||
local = (char *(*)()) __db_env_close_1;
|
||||
break;
|
||||
|
||||
case __DB_env_create:
|
||||
xdr_argument = xdr___env_create_msg;
|
||||
xdr_result = xdr___env_create_reply;
|
||||
local = (char *(*)()) __db_env_create_1;
|
||||
break;
|
||||
|
||||
case __DB_env_flags:
|
||||
xdr_argument = xdr___env_flags_msg;
|
||||
xdr_result = xdr___env_flags_reply;
|
||||
local = (char *(*)()) __db_env_flags_1;
|
||||
break;
|
||||
|
||||
case __DB_env_open:
|
||||
xdr_argument = xdr___env_open_msg;
|
||||
xdr_result = xdr___env_open_reply;
|
||||
local = (char *(*)()) __db_env_open_1;
|
||||
break;
|
||||
|
||||
case __DB_env_remove:
|
||||
xdr_argument = xdr___env_remove_msg;
|
||||
xdr_result = xdr___env_remove_reply;
|
||||
local = (char *(*)()) __db_env_remove_1;
|
||||
break;
|
||||
|
||||
case __DB_txn_abort:
|
||||
xdr_argument = xdr___txn_abort_msg;
|
||||
xdr_result = xdr___txn_abort_reply;
|
||||
local = (char *(*)()) __db_txn_abort_1;
|
||||
break;
|
||||
|
||||
case __DB_txn_begin:
|
||||
xdr_argument = xdr___txn_begin_msg;
|
||||
xdr_result = xdr___txn_begin_reply;
|
||||
local = (char *(*)()) __db_txn_begin_1;
|
||||
break;
|
||||
|
||||
case __DB_txn_commit:
|
||||
xdr_argument = xdr___txn_commit_msg;
|
||||
xdr_result = xdr___txn_commit_reply;
|
||||
local = (char *(*)()) __db_txn_commit_1;
|
||||
break;
|
||||
|
||||
case __DB_db_bt_maxkey:
|
||||
xdr_argument = xdr___db_bt_maxkey_msg;
|
||||
xdr_result = xdr___db_bt_maxkey_reply;
|
||||
local = (char *(*)()) __db_db_bt_maxkey_1;
|
||||
break;
|
||||
|
||||
case __DB_db_bt_minkey:
|
||||
xdr_argument = xdr___db_bt_minkey_msg;
|
||||
xdr_result = xdr___db_bt_minkey_reply;
|
||||
local = (char *(*)()) __db_db_bt_minkey_1;
|
||||
break;
|
||||
|
||||
case __DB_db_close:
|
||||
xdr_argument = xdr___db_close_msg;
|
||||
xdr_result = xdr___db_close_reply;
|
||||
local = (char *(*)()) __db_db_close_1;
|
||||
break;
|
||||
|
||||
case __DB_db_create:
|
||||
xdr_argument = xdr___db_create_msg;
|
||||
xdr_result = xdr___db_create_reply;
|
||||
local = (char *(*)()) __db_db_create_1;
|
||||
break;
|
||||
|
||||
case __DB_db_del:
|
||||
xdr_argument = xdr___db_del_msg;
|
||||
xdr_result = xdr___db_del_reply;
|
||||
local = (char *(*)()) __db_db_del_1;
|
||||
break;
|
||||
|
||||
case __DB_db_extentsize:
|
||||
xdr_argument = xdr___db_extentsize_msg;
|
||||
xdr_result = xdr___db_extentsize_reply;
|
||||
local = (char *(*)()) __db_db_extentsize_1;
|
||||
break;
|
||||
|
||||
case __DB_db_flags:
|
||||
xdr_argument = xdr___db_flags_msg;
|
||||
xdr_result = xdr___db_flags_reply;
|
||||
local = (char *(*)()) __db_db_flags_1;
|
||||
break;
|
||||
|
||||
case __DB_db_get:
|
||||
xdr_argument = xdr___db_get_msg;
|
||||
xdr_result = xdr___db_get_reply;
|
||||
local = (char *(*)()) __db_db_get_1;
|
||||
break;
|
||||
|
||||
case __DB_db_h_ffactor:
|
||||
xdr_argument = xdr___db_h_ffactor_msg;
|
||||
xdr_result = xdr___db_h_ffactor_reply;
|
||||
local = (char *(*)()) __db_db_h_ffactor_1;
|
||||
break;
|
||||
|
||||
case __DB_db_h_nelem:
|
||||
xdr_argument = xdr___db_h_nelem_msg;
|
||||
xdr_result = xdr___db_h_nelem_reply;
|
||||
local = (char *(*)()) __db_db_h_nelem_1;
|
||||
break;
|
||||
|
||||
case __DB_db_key_range:
|
||||
xdr_argument = xdr___db_key_range_msg;
|
||||
xdr_result = xdr___db_key_range_reply;
|
||||
local = (char *(*)()) __db_db_key_range_1;
|
||||
break;
|
||||
|
||||
case __DB_db_lorder:
|
||||
xdr_argument = xdr___db_lorder_msg;
|
||||
xdr_result = xdr___db_lorder_reply;
|
||||
local = (char *(*)()) __db_db_lorder_1;
|
||||
break;
|
||||
|
||||
case __DB_db_open:
|
||||
xdr_argument = xdr___db_open_msg;
|
||||
xdr_result = xdr___db_open_reply;
|
||||
local = (char *(*)()) __db_db_open_1;
|
||||
break;
|
||||
|
||||
case __DB_db_pagesize:
|
||||
xdr_argument = xdr___db_pagesize_msg;
|
||||
xdr_result = xdr___db_pagesize_reply;
|
||||
local = (char *(*)()) __db_db_pagesize_1;
|
||||
break;
|
||||
|
||||
case __DB_db_put:
|
||||
xdr_argument = xdr___db_put_msg;
|
||||
xdr_result = xdr___db_put_reply;
|
||||
local = (char *(*)()) __db_db_put_1;
|
||||
break;
|
||||
|
||||
case __DB_db_re_delim:
|
||||
xdr_argument = xdr___db_re_delim_msg;
|
||||
xdr_result = xdr___db_re_delim_reply;
|
||||
local = (char *(*)()) __db_db_re_delim_1;
|
||||
break;
|
||||
|
||||
case __DB_db_re_len:
|
||||
xdr_argument = xdr___db_re_len_msg;
|
||||
xdr_result = xdr___db_re_len_reply;
|
||||
local = (char *(*)()) __db_db_re_len_1;
|
||||
break;
|
||||
|
||||
case __DB_db_re_pad:
|
||||
xdr_argument = xdr___db_re_pad_msg;
|
||||
xdr_result = xdr___db_re_pad_reply;
|
||||
local = (char *(*)()) __db_db_re_pad_1;
|
||||
break;
|
||||
|
||||
case __DB_db_remove:
|
||||
xdr_argument = xdr___db_remove_msg;
|
||||
xdr_result = xdr___db_remove_reply;
|
||||
local = (char *(*)()) __db_db_remove_1;
|
||||
break;
|
||||
|
||||
case __DB_db_rename:
|
||||
xdr_argument = xdr___db_rename_msg;
|
||||
xdr_result = xdr___db_rename_reply;
|
||||
local = (char *(*)()) __db_db_rename_1;
|
||||
break;
|
||||
|
||||
case __DB_db_stat:
|
||||
xdr_argument = xdr___db_stat_msg;
|
||||
xdr_result = xdr___db_stat_reply;
|
||||
local = (char *(*)()) __db_db_stat_1;
|
||||
break;
|
||||
|
||||
case __DB_db_swapped:
|
||||
xdr_argument = xdr___db_swapped_msg;
|
||||
xdr_result = xdr___db_swapped_reply;
|
||||
local = (char *(*)()) __db_db_swapped_1;
|
||||
break;
|
||||
|
||||
case __DB_db_sync:
|
||||
xdr_argument = xdr___db_sync_msg;
|
||||
xdr_result = xdr___db_sync_reply;
|
||||
local = (char *(*)()) __db_db_sync_1;
|
||||
break;
|
||||
|
||||
case __DB_db_cursor:
|
||||
xdr_argument = xdr___db_cursor_msg;
|
||||
xdr_result = xdr___db_cursor_reply;
|
||||
local = (char *(*)()) __db_db_cursor_1;
|
||||
break;
|
||||
|
||||
case __DB_db_join:
|
||||
xdr_argument = xdr___db_join_msg;
|
||||
xdr_result = xdr___db_join_reply;
|
||||
local = (char *(*)()) __db_db_join_1;
|
||||
break;
|
||||
|
||||
case __DB_dbc_close:
|
||||
xdr_argument = xdr___dbc_close_msg;
|
||||
xdr_result = xdr___dbc_close_reply;
|
||||
local = (char *(*)()) __db_dbc_close_1;
|
||||
break;
|
||||
|
||||
case __DB_dbc_count:
|
||||
xdr_argument = xdr___dbc_count_msg;
|
||||
xdr_result = xdr___dbc_count_reply;
|
||||
local = (char *(*)()) __db_dbc_count_1;
|
||||
break;
|
||||
|
||||
case __DB_dbc_del:
|
||||
xdr_argument = xdr___dbc_del_msg;
|
||||
xdr_result = xdr___dbc_del_reply;
|
||||
local = (char *(*)()) __db_dbc_del_1;
|
||||
break;
|
||||
|
||||
case __DB_dbc_dup:
|
||||
xdr_argument = xdr___dbc_dup_msg;
|
||||
xdr_result = xdr___dbc_dup_reply;
|
||||
local = (char *(*)()) __db_dbc_dup_1;
|
||||
break;
|
||||
|
||||
case __DB_dbc_get:
|
||||
xdr_argument = xdr___dbc_get_msg;
|
||||
xdr_result = xdr___dbc_get_reply;
|
||||
local = (char *(*)()) __db_dbc_get_1;
|
||||
break;
|
||||
|
||||
case __DB_dbc_put:
|
||||
xdr_argument = xdr___dbc_put_msg;
|
||||
xdr_result = xdr___dbc_put_reply;
|
||||
local = (char *(*)()) __db_dbc_put_1;
|
||||
break;
|
||||
|
||||
default:
|
||||
svcerr_noproc(transp);
|
||||
return;
|
||||
}
|
||||
(void) memset((char *)&argument, 0, sizeof (argument));
|
||||
if (!svc_getargs(transp, xdr_argument, &argument)) {
|
||||
svcerr_decode(transp);
|
||||
return;
|
||||
}
|
||||
result = (*local)(&argument, rqstp);
|
||||
if (result != NULL && !svc_sendreply(transp, xdr_result, result)) {
|
||||
svcerr_systemerr(transp);
|
||||
}
|
||||
if (!svc_freeargs(transp, xdr_argument, &argument)) {
|
||||
fprintf(stderr, "unable to free arguments");
|
||||
exit(1);
|
||||
}
|
||||
__dbsrv_timeout(0);
|
||||
return;
|
||||
}
|
||||
|
||||
void __dbsrv_main()
|
||||
{
|
||||
register SVCXPRT *transp;
|
||||
|
||||
(void) pmap_unset(DB_SERVERPROG, DB_SERVERVERS);
|
||||
|
||||
transp = svctcp_create(RPC_ANYSOCK, 0, 0);
|
||||
if (transp == NULL) {
|
||||
fprintf(stderr, "cannot create tcp service.");
|
||||
exit(1);
|
||||
}
|
||||
if (!svc_register(transp, DB_SERVERPROG, DB_SERVERVERS, db_serverprog_1, IPPROTO_TCP)) {
|
||||
fprintf(stderr, "unable to register (DB_SERVERPROG, DB_SERVERVERS, tcp).");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
svc_run();
|
||||
fprintf(stderr, "svc_run returned");
|
||||
exit(1);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
#endif /* HAVE_RPC */
|
File diff suppressed because it is too large
Load diff
|
@ -1,703 +0,0 @@
|
|||
/* Do not edit: automatically built by gen_rpc.awk. */
|
||||
#include "db_config.h"
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <rpc/rpc.h>
|
||||
#include <rpc/xdr.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
#include "db_server.h"
|
||||
|
||||
#include "db_int.h"
|
||||
#include "db_server_int.h"
|
||||
#include "rpc_server_ext.h"
|
||||
|
||||
#include "gen_server_ext.h"
|
||||
|
||||
__env_cachesize_reply *
|
||||
__db_env_cachesize_1(req)
|
||||
__env_cachesize_msg *req;
|
||||
{
|
||||
static __env_cachesize_reply reply; /* must be static */
|
||||
|
||||
__env_cachesize_1_proc(req->dbenvcl_id,
|
||||
req->gbytes,
|
||||
req->bytes,
|
||||
req->ncache,
|
||||
&reply);
|
||||
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__env_close_reply *
|
||||
__db_env_close_1(req)
|
||||
__env_close_msg *req;
|
||||
{
|
||||
static __env_close_reply reply; /* must be static */
|
||||
|
||||
__env_close_1_proc(req->dbenvcl_id,
|
||||
req->flags,
|
||||
&reply);
|
||||
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__env_create_reply *
|
||||
__db_env_create_1(req)
|
||||
__env_create_msg *req;
|
||||
{
|
||||
static __env_create_reply reply; /* must be static */
|
||||
|
||||
__env_create_1_proc(req->timeout,
|
||||
&reply);
|
||||
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__env_flags_reply *
|
||||
__db_env_flags_1(req)
|
||||
__env_flags_msg *req;
|
||||
{
|
||||
static __env_flags_reply reply; /* must be static */
|
||||
|
||||
__env_flags_1_proc(req->dbenvcl_id,
|
||||
req->flags,
|
||||
req->onoff,
|
||||
&reply);
|
||||
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__env_open_reply *
|
||||
__db_env_open_1(req)
|
||||
__env_open_msg *req;
|
||||
{
|
||||
static __env_open_reply reply; /* must be static */
|
||||
|
||||
__env_open_1_proc(req->dbenvcl_id,
|
||||
(*req->home == '\0') ? NULL : req->home,
|
||||
req->flags,
|
||||
req->mode,
|
||||
&reply);
|
||||
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__env_remove_reply *
|
||||
__db_env_remove_1(req)
|
||||
__env_remove_msg *req;
|
||||
{
|
||||
static __env_remove_reply reply; /* must be static */
|
||||
|
||||
__env_remove_1_proc(req->dbenvcl_id,
|
||||
(*req->home == '\0') ? NULL : req->home,
|
||||
req->flags,
|
||||
&reply);
|
||||
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__txn_abort_reply *
|
||||
__db_txn_abort_1(req)
|
||||
__txn_abort_msg *req;
|
||||
{
|
||||
static __txn_abort_reply reply; /* must be static */
|
||||
|
||||
__txn_abort_1_proc(req->txnpcl_id,
|
||||
&reply);
|
||||
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__txn_begin_reply *
|
||||
__db_txn_begin_1(req)
|
||||
__txn_begin_msg *req;
|
||||
{
|
||||
static __txn_begin_reply reply; /* must be static */
|
||||
|
||||
__txn_begin_1_proc(req->envpcl_id,
|
||||
req->parentcl_id,
|
||||
req->flags,
|
||||
&reply);
|
||||
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__txn_commit_reply *
|
||||
__db_txn_commit_1(req)
|
||||
__txn_commit_msg *req;
|
||||
{
|
||||
static __txn_commit_reply reply; /* must be static */
|
||||
|
||||
__txn_commit_1_proc(req->txnpcl_id,
|
||||
req->flags,
|
||||
&reply);
|
||||
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__db_bt_maxkey_reply *
|
||||
__db_db_bt_maxkey_1(req)
|
||||
__db_bt_maxkey_msg *req;
|
||||
{
|
||||
static __db_bt_maxkey_reply reply; /* must be static */
|
||||
|
||||
__db_bt_maxkey_1_proc(req->dbpcl_id,
|
||||
req->maxkey,
|
||||
&reply);
|
||||
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__db_bt_minkey_reply *
|
||||
__db_db_bt_minkey_1(req)
|
||||
__db_bt_minkey_msg *req;
|
||||
{
|
||||
static __db_bt_minkey_reply reply; /* must be static */
|
||||
|
||||
__db_bt_minkey_1_proc(req->dbpcl_id,
|
||||
req->minkey,
|
||||
&reply);
|
||||
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__db_close_reply *
|
||||
__db_db_close_1(req)
|
||||
__db_close_msg *req;
|
||||
{
|
||||
static __db_close_reply reply; /* must be static */
|
||||
|
||||
__db_close_1_proc(req->dbpcl_id,
|
||||
req->flags,
|
||||
&reply);
|
||||
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__db_create_reply *
|
||||
__db_db_create_1(req)
|
||||
__db_create_msg *req;
|
||||
{
|
||||
static __db_create_reply reply; /* must be static */
|
||||
|
||||
__db_create_1_proc(req->flags,
|
||||
req->envpcl_id,
|
||||
&reply);
|
||||
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__db_del_reply *
|
||||
__db_db_del_1(req)
|
||||
__db_del_msg *req;
|
||||
{
|
||||
static __db_del_reply reply; /* must be static */
|
||||
|
||||
__db_del_1_proc(req->dbpcl_id,
|
||||
req->txnpcl_id,
|
||||
req->keydlen,
|
||||
req->keydoff,
|
||||
req->keyflags,
|
||||
req->keydata.keydata_val,
|
||||
req->keydata.keydata_len,
|
||||
req->flags,
|
||||
&reply);
|
||||
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__db_extentsize_reply *
|
||||
__db_db_extentsize_1(req)
|
||||
__db_extentsize_msg *req;
|
||||
{
|
||||
static __db_extentsize_reply reply; /* must be static */
|
||||
|
||||
__db_extentsize_1_proc(req->dbpcl_id,
|
||||
req->extentsize,
|
||||
&reply);
|
||||
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__db_flags_reply *
|
||||
__db_db_flags_1(req)
|
||||
__db_flags_msg *req;
|
||||
{
|
||||
static __db_flags_reply reply; /* must be static */
|
||||
|
||||
__db_flags_1_proc(req->dbpcl_id,
|
||||
req->flags,
|
||||
&reply);
|
||||
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__db_get_reply *
|
||||
__db_db_get_1(req)
|
||||
__db_get_msg *req;
|
||||
{
|
||||
static __db_get_reply reply; /* must be static */
|
||||
static int __db_get_free = 0; /* must be static */
|
||||
|
||||
if (__db_get_free)
|
||||
xdr_free((xdrproc_t)xdr___db_get_reply, (void *)&reply);
|
||||
__db_get_free = 0;
|
||||
|
||||
/* Reinitialize allocated fields */
|
||||
reply.keydata.keydata_val = NULL;
|
||||
reply.datadata.datadata_val = NULL;
|
||||
|
||||
__db_get_1_proc(req->dbpcl_id,
|
||||
req->txnpcl_id,
|
||||
req->keydlen,
|
||||
req->keydoff,
|
||||
req->keyflags,
|
||||
req->keydata.keydata_val,
|
||||
req->keydata.keydata_len,
|
||||
req->datadlen,
|
||||
req->datadoff,
|
||||
req->dataflags,
|
||||
req->datadata.datadata_val,
|
||||
req->datadata.datadata_len,
|
||||
req->flags,
|
||||
&reply,
|
||||
&__db_get_free);
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__db_h_ffactor_reply *
|
||||
__db_db_h_ffactor_1(req)
|
||||
__db_h_ffactor_msg *req;
|
||||
{
|
||||
static __db_h_ffactor_reply reply; /* must be static */
|
||||
|
||||
__db_h_ffactor_1_proc(req->dbpcl_id,
|
||||
req->ffactor,
|
||||
&reply);
|
||||
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__db_h_nelem_reply *
|
||||
__db_db_h_nelem_1(req)
|
||||
__db_h_nelem_msg *req;
|
||||
{
|
||||
static __db_h_nelem_reply reply; /* must be static */
|
||||
|
||||
__db_h_nelem_1_proc(req->dbpcl_id,
|
||||
req->nelem,
|
||||
&reply);
|
||||
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__db_key_range_reply *
|
||||
__db_db_key_range_1(req)
|
||||
__db_key_range_msg *req;
|
||||
{
|
||||
static __db_key_range_reply reply; /* must be static */
|
||||
|
||||
__db_key_range_1_proc(req->dbpcl_id,
|
||||
req->txnpcl_id,
|
||||
req->keydlen,
|
||||
req->keydoff,
|
||||
req->keyflags,
|
||||
req->keydata.keydata_val,
|
||||
req->keydata.keydata_len,
|
||||
req->flags,
|
||||
&reply);
|
||||
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__db_lorder_reply *
|
||||
__db_db_lorder_1(req)
|
||||
__db_lorder_msg *req;
|
||||
{
|
||||
static __db_lorder_reply reply; /* must be static */
|
||||
|
||||
__db_lorder_1_proc(req->dbpcl_id,
|
||||
req->lorder,
|
||||
&reply);
|
||||
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__db_open_reply *
|
||||
__db_db_open_1(req)
|
||||
__db_open_msg *req;
|
||||
{
|
||||
static __db_open_reply reply; /* must be static */
|
||||
|
||||
__db_open_1_proc(req->dbpcl_id,
|
||||
(*req->name == '\0') ? NULL : req->name,
|
||||
(*req->subdb == '\0') ? NULL : req->subdb,
|
||||
req->type,
|
||||
req->flags,
|
||||
req->mode,
|
||||
&reply);
|
||||
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__db_pagesize_reply *
|
||||
__db_db_pagesize_1(req)
|
||||
__db_pagesize_msg *req;
|
||||
{
|
||||
static __db_pagesize_reply reply; /* must be static */
|
||||
|
||||
__db_pagesize_1_proc(req->dbpcl_id,
|
||||
req->pagesize,
|
||||
&reply);
|
||||
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__db_put_reply *
|
||||
__db_db_put_1(req)
|
||||
__db_put_msg *req;
|
||||
{
|
||||
static __db_put_reply reply; /* must be static */
|
||||
static int __db_put_free = 0; /* must be static */
|
||||
|
||||
if (__db_put_free)
|
||||
xdr_free((xdrproc_t)xdr___db_put_reply, (void *)&reply);
|
||||
__db_put_free = 0;
|
||||
|
||||
/* Reinitialize allocated fields */
|
||||
reply.keydata.keydata_val = NULL;
|
||||
|
||||
__db_put_1_proc(req->dbpcl_id,
|
||||
req->txnpcl_id,
|
||||
req->keydlen,
|
||||
req->keydoff,
|
||||
req->keyflags,
|
||||
req->keydata.keydata_val,
|
||||
req->keydata.keydata_len,
|
||||
req->datadlen,
|
||||
req->datadoff,
|
||||
req->dataflags,
|
||||
req->datadata.datadata_val,
|
||||
req->datadata.datadata_len,
|
||||
req->flags,
|
||||
&reply,
|
||||
&__db_put_free);
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__db_re_delim_reply *
|
||||
__db_db_re_delim_1(req)
|
||||
__db_re_delim_msg *req;
|
||||
{
|
||||
static __db_re_delim_reply reply; /* must be static */
|
||||
|
||||
__db_re_delim_1_proc(req->dbpcl_id,
|
||||
req->delim,
|
||||
&reply);
|
||||
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__db_re_len_reply *
|
||||
__db_db_re_len_1(req)
|
||||
__db_re_len_msg *req;
|
||||
{
|
||||
static __db_re_len_reply reply; /* must be static */
|
||||
|
||||
__db_re_len_1_proc(req->dbpcl_id,
|
||||
req->len,
|
||||
&reply);
|
||||
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__db_re_pad_reply *
|
||||
__db_db_re_pad_1(req)
|
||||
__db_re_pad_msg *req;
|
||||
{
|
||||
static __db_re_pad_reply reply; /* must be static */
|
||||
|
||||
__db_re_pad_1_proc(req->dbpcl_id,
|
||||
req->pad,
|
||||
&reply);
|
||||
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__db_remove_reply *
|
||||
__db_db_remove_1(req)
|
||||
__db_remove_msg *req;
|
||||
{
|
||||
static __db_remove_reply reply; /* must be static */
|
||||
|
||||
__db_remove_1_proc(req->dbpcl_id,
|
||||
(*req->name == '\0') ? NULL : req->name,
|
||||
(*req->subdb == '\0') ? NULL : req->subdb,
|
||||
req->flags,
|
||||
&reply);
|
||||
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__db_rename_reply *
|
||||
__db_db_rename_1(req)
|
||||
__db_rename_msg *req;
|
||||
{
|
||||
static __db_rename_reply reply; /* must be static */
|
||||
|
||||
__db_rename_1_proc(req->dbpcl_id,
|
||||
(*req->name == '\0') ? NULL : req->name,
|
||||
(*req->subdb == '\0') ? NULL : req->subdb,
|
||||
(*req->newname == '\0') ? NULL : req->newname,
|
||||
req->flags,
|
||||
&reply);
|
||||
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__db_stat_reply *
|
||||
__db_db_stat_1(req)
|
||||
__db_stat_msg *req;
|
||||
{
|
||||
static __db_stat_reply reply; /* must be static */
|
||||
static int __db_stat_free = 0; /* must be static */
|
||||
|
||||
if (__db_stat_free)
|
||||
xdr_free((xdrproc_t)xdr___db_stat_reply, (void *)&reply);
|
||||
__db_stat_free = 0;
|
||||
|
||||
/* Reinitialize allocated fields */
|
||||
reply.statslist = NULL;
|
||||
|
||||
__db_stat_1_proc(req->dbpcl_id,
|
||||
req->flags,
|
||||
&reply,
|
||||
&__db_stat_free);
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__db_swapped_reply *
|
||||
__db_db_swapped_1(req)
|
||||
__db_swapped_msg *req;
|
||||
{
|
||||
static __db_swapped_reply reply; /* must be static */
|
||||
|
||||
__db_swapped_1_proc(req->dbpcl_id,
|
||||
&reply);
|
||||
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__db_sync_reply *
|
||||
__db_db_sync_1(req)
|
||||
__db_sync_msg *req;
|
||||
{
|
||||
static __db_sync_reply reply; /* must be static */
|
||||
|
||||
__db_sync_1_proc(req->dbpcl_id,
|
||||
req->flags,
|
||||
&reply);
|
||||
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__db_cursor_reply *
|
||||
__db_db_cursor_1(req)
|
||||
__db_cursor_msg *req;
|
||||
{
|
||||
static __db_cursor_reply reply; /* must be static */
|
||||
|
||||
__db_cursor_1_proc(req->dbpcl_id,
|
||||
req->txnpcl_id,
|
||||
req->flags,
|
||||
&reply);
|
||||
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
int __db_db_join_curslist __P((__db_join_curslist *, u_int32_t **));
|
||||
void __db_db_join_cursfree __P((u_int32_t *));
|
||||
|
||||
__db_join_reply *
|
||||
__db_db_join_1(req)
|
||||
__db_join_msg *req;
|
||||
{
|
||||
u_int32_t *__db_curslist;
|
||||
int ret;
|
||||
static __db_join_reply reply; /* must be static */
|
||||
|
||||
if ((ret = __db_db_join_curslist(req->curslist, &__db_curslist)) != 0)
|
||||
goto out;
|
||||
|
||||
__db_join_1_proc(req->dbpcl_id,
|
||||
__db_curslist,
|
||||
req->flags,
|
||||
&reply);
|
||||
|
||||
__db_db_join_cursfree(__db_curslist);
|
||||
|
||||
out:
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
int
|
||||
__db_db_join_curslist(locp, ppp)
|
||||
__db_join_curslist *locp;
|
||||
u_int32_t **ppp;
|
||||
{
|
||||
u_int32_t *pp;
|
||||
int cnt, ret, size;
|
||||
__db_join_curslist *nl;
|
||||
|
||||
for (cnt = 0, nl = locp; nl != NULL; cnt++, nl = nl->next)
|
||||
;
|
||||
|
||||
if (cnt == 0) {
|
||||
*ppp = NULL;
|
||||
return (0);
|
||||
}
|
||||
size = sizeof(*pp) * (cnt + 1);
|
||||
if ((ret = __os_malloc(NULL, size, NULL, ppp)) != 0)
|
||||
return (ret);
|
||||
memset(*ppp, 0, size);
|
||||
for (pp = *ppp, nl = locp; nl != NULL; nl = nl->next, pp++) {
|
||||
*pp = *(u_int32_t *)nl->ent.ent_val;
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
void
|
||||
__db_db_join_cursfree(pp)
|
||||
u_int32_t *pp;
|
||||
{
|
||||
size_t size;
|
||||
u_int32_t *p;
|
||||
|
||||
if (pp == NULL)
|
||||
return;
|
||||
size = sizeof(*p);
|
||||
for (p = pp; *p != 0; p++) {
|
||||
size += sizeof(*p);
|
||||
}
|
||||
__os_free(pp, size);
|
||||
}
|
||||
|
||||
__dbc_close_reply *
|
||||
__db_dbc_close_1(req)
|
||||
__dbc_close_msg *req;
|
||||
{
|
||||
static __dbc_close_reply reply; /* must be static */
|
||||
|
||||
__dbc_close_1_proc(req->dbccl_id,
|
||||
&reply);
|
||||
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__dbc_count_reply *
|
||||
__db_dbc_count_1(req)
|
||||
__dbc_count_msg *req;
|
||||
{
|
||||
static __dbc_count_reply reply; /* must be static */
|
||||
|
||||
__dbc_count_1_proc(req->dbccl_id,
|
||||
req->flags,
|
||||
&reply);
|
||||
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__dbc_del_reply *
|
||||
__db_dbc_del_1(req)
|
||||
__dbc_del_msg *req;
|
||||
{
|
||||
static __dbc_del_reply reply; /* must be static */
|
||||
|
||||
__dbc_del_1_proc(req->dbccl_id,
|
||||
req->flags,
|
||||
&reply);
|
||||
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__dbc_dup_reply *
|
||||
__db_dbc_dup_1(req)
|
||||
__dbc_dup_msg *req;
|
||||
{
|
||||
static __dbc_dup_reply reply; /* must be static */
|
||||
|
||||
__dbc_dup_1_proc(req->dbccl_id,
|
||||
req->flags,
|
||||
&reply);
|
||||
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__dbc_get_reply *
|
||||
__db_dbc_get_1(req)
|
||||
__dbc_get_msg *req;
|
||||
{
|
||||
static __dbc_get_reply reply; /* must be static */
|
||||
static int __dbc_get_free = 0; /* must be static */
|
||||
|
||||
if (__dbc_get_free)
|
||||
xdr_free((xdrproc_t)xdr___dbc_get_reply, (void *)&reply);
|
||||
__dbc_get_free = 0;
|
||||
|
||||
/* Reinitialize allocated fields */
|
||||
reply.keydata.keydata_val = NULL;
|
||||
reply.datadata.datadata_val = NULL;
|
||||
|
||||
__dbc_get_1_proc(req->dbccl_id,
|
||||
req->keydlen,
|
||||
req->keydoff,
|
||||
req->keyflags,
|
||||
req->keydata.keydata_val,
|
||||
req->keydata.keydata_len,
|
||||
req->datadlen,
|
||||
req->datadoff,
|
||||
req->dataflags,
|
||||
req->datadata.datadata_val,
|
||||
req->datadata.datadata_len,
|
||||
req->flags,
|
||||
&reply,
|
||||
&__dbc_get_free);
|
||||
return (&reply);
|
||||
}
|
||||
|
||||
__dbc_put_reply *
|
||||
__db_dbc_put_1(req)
|
||||
__dbc_put_msg *req;
|
||||
{
|
||||
static __dbc_put_reply reply; /* must be static */
|
||||
static int __dbc_put_free = 0; /* must be static */
|
||||
|
||||
if (__dbc_put_free)
|
||||
xdr_free((xdrproc_t)xdr___dbc_put_reply, (void *)&reply);
|
||||
__dbc_put_free = 0;
|
||||
|
||||
/* Reinitialize allocated fields */
|
||||
reply.keydata.keydata_val = NULL;
|
||||
|
||||
__dbc_put_1_proc(req->dbccl_id,
|
||||
req->keydlen,
|
||||
req->keydoff,
|
||||
req->keyflags,
|
||||
req->keydata.keydata_val,
|
||||
req->keydata.keydata_len,
|
||||
req->datadlen,
|
||||
req->datadoff,
|
||||
req->dataflags,
|
||||
req->datadata.datadata_val,
|
||||
req->datadata.datadata_len,
|
||||
req->flags,
|
||||
&reply,
|
||||
&__dbc_put_free);
|
||||
return (&reply);
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
set tclsh_path @TCL_TCLSH@
|
||||
set tcllib .libs/libdb_tcl-@DB_VERSION_MAJOR@.@DB_VERSION_MINOR@.@SOSUFFIX@
|
||||
set rpc_server localhost
|
||||
set rpc_path .
|
||||
set test_path @srcdir@/../test
|
||||
|
||||
set KILL "@db_cv_path_kill@"
|
||||
|
||||
# DO NOT EDIT BELOW THIS LINE: automatically built by dist/s_tcl.
|
||||
|
||||
global dict
|
||||
global testdir
|
||||
global util_path
|
||||
set testdir ./TESTDIR
|
||||
set rpc_testdir $rpc_path/TESTDIR
|
||||
|
||||
global is_hp_test
|
||||
global is_qnx_test
|
||||
global is_windows_test
|
|
@ -1,893 +0,0 @@
|
|||
/* Do not edit: automatically built by gen_rec.awk. */
|
||||
#include "db_config.h"
|
||||
|
||||
#ifndef NO_SYSTEM_INCLUDES
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#include "db_int.h"
|
||||
#include "db_page.h"
|
||||
#include "db_dispatch.h"
|
||||
#include "db_am.h"
|
||||
#include "txn.h"
|
||||
|
||||
int
|
||||
__txn_old_regop_print(dbenv, dbtp, lsnp, notused2, notused3)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops notused2;
|
||||
void *notused3;
|
||||
{
|
||||
__txn_old_regop_args *argp;
|
||||
u_int32_t i;
|
||||
u_int ch;
|
||||
int ret;
|
||||
|
||||
i = 0;
|
||||
ch = 0;
|
||||
notused2 = DB_TXN_ABORT;
|
||||
notused3 = NULL;
|
||||
|
||||
if ((ret = __txn_old_regop_read(dbenv, dbtp->data, &argp)) != 0)
|
||||
return (ret);
|
||||
printf("[%lu][%lu]txn_old_regop: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
|
||||
(u_long)lsnp->file,
|
||||
(u_long)lsnp->offset,
|
||||
(u_long)argp->type,
|
||||
(u_long)argp->txnid->txnid,
|
||||
(u_long)argp->prev_lsn.file,
|
||||
(u_long)argp->prev_lsn.offset);
|
||||
printf("\topcode: %lu\n", (u_long)argp->opcode);
|
||||
printf("\n");
|
||||
__os_free(argp, 0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__txn_old_regop_read(dbenv, recbuf, argpp)
|
||||
DB_ENV *dbenv;
|
||||
void *recbuf;
|
||||
__txn_old_regop_args **argpp;
|
||||
{
|
||||
__txn_old_regop_args *argp;
|
||||
u_int8_t *bp;
|
||||
int ret;
|
||||
|
||||
ret = __os_malloc(dbenv, sizeof(__txn_old_regop_args) +
|
||||
sizeof(DB_TXN), NULL, &argp);
|
||||
if (ret != 0)
|
||||
return (ret);
|
||||
argp->txnid = (DB_TXN *)&argp[1];
|
||||
bp = recbuf;
|
||||
memcpy(&argp->type, bp, sizeof(argp->type));
|
||||
bp += sizeof(argp->type);
|
||||
memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid));
|
||||
bp += sizeof(argp->txnid->txnid);
|
||||
memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
|
||||
bp += sizeof(DB_LSN);
|
||||
memcpy(&argp->opcode, bp, sizeof(argp->opcode));
|
||||
bp += sizeof(argp->opcode);
|
||||
*argpp = argp;
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__txn_regop_log(dbenv, txnid, ret_lsnp, flags,
|
||||
opcode, timestamp)
|
||||
DB_ENV *dbenv;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN *ret_lsnp;
|
||||
u_int32_t flags;
|
||||
u_int32_t opcode;
|
||||
int32_t timestamp;
|
||||
{
|
||||
DBT logrec;
|
||||
DB_LSN *lsnp, null_lsn;
|
||||
u_int32_t rectype, txn_num;
|
||||
int ret;
|
||||
u_int8_t *bp;
|
||||
|
||||
rectype = DB_txn_regop;
|
||||
if (txnid != NULL &&
|
||||
TAILQ_FIRST(&txnid->kids) != NULL &&
|
||||
(ret = __txn_activekids(dbenv, rectype, txnid)) != 0)
|
||||
return (ret);
|
||||
txn_num = txnid == NULL ? 0 : txnid->txnid;
|
||||
if (txnid == NULL) {
|
||||
ZERO_LSN(null_lsn);
|
||||
lsnp = &null_lsn;
|
||||
} else
|
||||
lsnp = &txnid->last_lsn;
|
||||
logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
|
||||
+ sizeof(opcode)
|
||||
+ sizeof(timestamp);
|
||||
if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0)
|
||||
return (ret);
|
||||
|
||||
bp = logrec.data;
|
||||
memcpy(bp, &rectype, sizeof(rectype));
|
||||
bp += sizeof(rectype);
|
||||
memcpy(bp, &txn_num, sizeof(txn_num));
|
||||
bp += sizeof(txn_num);
|
||||
memcpy(bp, lsnp, sizeof(DB_LSN));
|
||||
bp += sizeof(DB_LSN);
|
||||
memcpy(bp, &opcode, sizeof(opcode));
|
||||
bp += sizeof(opcode);
|
||||
memcpy(bp, ×tamp, sizeof(timestamp));
|
||||
bp += sizeof(timestamp);
|
||||
DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size);
|
||||
ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags);
|
||||
if (txnid != NULL)
|
||||
txnid->last_lsn = *ret_lsnp;
|
||||
__os_free(logrec.data, logrec.size);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
int
|
||||
__txn_regop_print(dbenv, dbtp, lsnp, notused2, notused3)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops notused2;
|
||||
void *notused3;
|
||||
{
|
||||
__txn_regop_args *argp;
|
||||
u_int32_t i;
|
||||
u_int ch;
|
||||
int ret;
|
||||
|
||||
i = 0;
|
||||
ch = 0;
|
||||
notused2 = DB_TXN_ABORT;
|
||||
notused3 = NULL;
|
||||
|
||||
if ((ret = __txn_regop_read(dbenv, dbtp->data, &argp)) != 0)
|
||||
return (ret);
|
||||
printf("[%lu][%lu]txn_regop: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
|
||||
(u_long)lsnp->file,
|
||||
(u_long)lsnp->offset,
|
||||
(u_long)argp->type,
|
||||
(u_long)argp->txnid->txnid,
|
||||
(u_long)argp->prev_lsn.file,
|
||||
(u_long)argp->prev_lsn.offset);
|
||||
printf("\topcode: %lu\n", (u_long)argp->opcode);
|
||||
printf("\ttimestamp: %ld\n", (long)argp->timestamp);
|
||||
printf("\n");
|
||||
__os_free(argp, 0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__txn_regop_read(dbenv, recbuf, argpp)
|
||||
DB_ENV *dbenv;
|
||||
void *recbuf;
|
||||
__txn_regop_args **argpp;
|
||||
{
|
||||
__txn_regop_args *argp;
|
||||
u_int8_t *bp;
|
||||
int ret;
|
||||
|
||||
ret = __os_malloc(dbenv, sizeof(__txn_regop_args) +
|
||||
sizeof(DB_TXN), NULL, &argp);
|
||||
if (ret != 0)
|
||||
return (ret);
|
||||
argp->txnid = (DB_TXN *)&argp[1];
|
||||
bp = recbuf;
|
||||
memcpy(&argp->type, bp, sizeof(argp->type));
|
||||
bp += sizeof(argp->type);
|
||||
memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid));
|
||||
bp += sizeof(argp->txnid->txnid);
|
||||
memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
|
||||
bp += sizeof(DB_LSN);
|
||||
memcpy(&argp->opcode, bp, sizeof(argp->opcode));
|
||||
bp += sizeof(argp->opcode);
|
||||
memcpy(&argp->timestamp, bp, sizeof(argp->timestamp));
|
||||
bp += sizeof(argp->timestamp);
|
||||
*argpp = argp;
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__txn_old_ckp_print(dbenv, dbtp, lsnp, notused2, notused3)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops notused2;
|
||||
void *notused3;
|
||||
{
|
||||
__txn_old_ckp_args *argp;
|
||||
u_int32_t i;
|
||||
u_int ch;
|
||||
int ret;
|
||||
|
||||
i = 0;
|
||||
ch = 0;
|
||||
notused2 = DB_TXN_ABORT;
|
||||
notused3 = NULL;
|
||||
|
||||
if ((ret = __txn_old_ckp_read(dbenv, dbtp->data, &argp)) != 0)
|
||||
return (ret);
|
||||
printf("[%lu][%lu]txn_old_ckp: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
|
||||
(u_long)lsnp->file,
|
||||
(u_long)lsnp->offset,
|
||||
(u_long)argp->type,
|
||||
(u_long)argp->txnid->txnid,
|
||||
(u_long)argp->prev_lsn.file,
|
||||
(u_long)argp->prev_lsn.offset);
|
||||
printf("\tckp_lsn: [%lu][%lu]\n",
|
||||
(u_long)argp->ckp_lsn.file, (u_long)argp->ckp_lsn.offset);
|
||||
printf("\tlast_ckp: [%lu][%lu]\n",
|
||||
(u_long)argp->last_ckp.file, (u_long)argp->last_ckp.offset);
|
||||
printf("\n");
|
||||
__os_free(argp, 0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__txn_old_ckp_read(dbenv, recbuf, argpp)
|
||||
DB_ENV *dbenv;
|
||||
void *recbuf;
|
||||
__txn_old_ckp_args **argpp;
|
||||
{
|
||||
__txn_old_ckp_args *argp;
|
||||
u_int8_t *bp;
|
||||
int ret;
|
||||
|
||||
ret = __os_malloc(dbenv, sizeof(__txn_old_ckp_args) +
|
||||
sizeof(DB_TXN), NULL, &argp);
|
||||
if (ret != 0)
|
||||
return (ret);
|
||||
argp->txnid = (DB_TXN *)&argp[1];
|
||||
bp = recbuf;
|
||||
memcpy(&argp->type, bp, sizeof(argp->type));
|
||||
bp += sizeof(argp->type);
|
||||
memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid));
|
||||
bp += sizeof(argp->txnid->txnid);
|
||||
memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
|
||||
bp += sizeof(DB_LSN);
|
||||
memcpy(&argp->ckp_lsn, bp, sizeof(argp->ckp_lsn));
|
||||
bp += sizeof(argp->ckp_lsn);
|
||||
memcpy(&argp->last_ckp, bp, sizeof(argp->last_ckp));
|
||||
bp += sizeof(argp->last_ckp);
|
||||
*argpp = argp;
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__txn_ckp_log(dbenv, txnid, ret_lsnp, flags,
|
||||
ckp_lsn, last_ckp, timestamp)
|
||||
DB_ENV *dbenv;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN *ret_lsnp;
|
||||
u_int32_t flags;
|
||||
DB_LSN * ckp_lsn;
|
||||
DB_LSN * last_ckp;
|
||||
int32_t timestamp;
|
||||
{
|
||||
DBT logrec;
|
||||
DB_LSN *lsnp, null_lsn;
|
||||
u_int32_t rectype, txn_num;
|
||||
int ret;
|
||||
u_int8_t *bp;
|
||||
|
||||
rectype = DB_txn_ckp;
|
||||
if (txnid != NULL &&
|
||||
TAILQ_FIRST(&txnid->kids) != NULL &&
|
||||
(ret = __txn_activekids(dbenv, rectype, txnid)) != 0)
|
||||
return (ret);
|
||||
txn_num = txnid == NULL ? 0 : txnid->txnid;
|
||||
if (txnid == NULL) {
|
||||
ZERO_LSN(null_lsn);
|
||||
lsnp = &null_lsn;
|
||||
} else
|
||||
lsnp = &txnid->last_lsn;
|
||||
logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
|
||||
+ sizeof(*ckp_lsn)
|
||||
+ sizeof(*last_ckp)
|
||||
+ sizeof(timestamp);
|
||||
if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0)
|
||||
return (ret);
|
||||
|
||||
bp = logrec.data;
|
||||
memcpy(bp, &rectype, sizeof(rectype));
|
||||
bp += sizeof(rectype);
|
||||
memcpy(bp, &txn_num, sizeof(txn_num));
|
||||
bp += sizeof(txn_num);
|
||||
memcpy(bp, lsnp, sizeof(DB_LSN));
|
||||
bp += sizeof(DB_LSN);
|
||||
if (ckp_lsn != NULL)
|
||||
memcpy(bp, ckp_lsn, sizeof(*ckp_lsn));
|
||||
else
|
||||
memset(bp, 0, sizeof(*ckp_lsn));
|
||||
bp += sizeof(*ckp_lsn);
|
||||
if (last_ckp != NULL)
|
||||
memcpy(bp, last_ckp, sizeof(*last_ckp));
|
||||
else
|
||||
memset(bp, 0, sizeof(*last_ckp));
|
||||
bp += sizeof(*last_ckp);
|
||||
memcpy(bp, ×tamp, sizeof(timestamp));
|
||||
bp += sizeof(timestamp);
|
||||
DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size);
|
||||
ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags);
|
||||
if (txnid != NULL)
|
||||
txnid->last_lsn = *ret_lsnp;
|
||||
__os_free(logrec.data, logrec.size);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
int
|
||||
__txn_ckp_print(dbenv, dbtp, lsnp, notused2, notused3)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops notused2;
|
||||
void *notused3;
|
||||
{
|
||||
__txn_ckp_args *argp;
|
||||
u_int32_t i;
|
||||
u_int ch;
|
||||
int ret;
|
||||
|
||||
i = 0;
|
||||
ch = 0;
|
||||
notused2 = DB_TXN_ABORT;
|
||||
notused3 = NULL;
|
||||
|
||||
if ((ret = __txn_ckp_read(dbenv, dbtp->data, &argp)) != 0)
|
||||
return (ret);
|
||||
printf("[%lu][%lu]txn_ckp: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
|
||||
(u_long)lsnp->file,
|
||||
(u_long)lsnp->offset,
|
||||
(u_long)argp->type,
|
||||
(u_long)argp->txnid->txnid,
|
||||
(u_long)argp->prev_lsn.file,
|
||||
(u_long)argp->prev_lsn.offset);
|
||||
printf("\tckp_lsn: [%lu][%lu]\n",
|
||||
(u_long)argp->ckp_lsn.file, (u_long)argp->ckp_lsn.offset);
|
||||
printf("\tlast_ckp: [%lu][%lu]\n",
|
||||
(u_long)argp->last_ckp.file, (u_long)argp->last_ckp.offset);
|
||||
printf("\ttimestamp: %ld\n", (long)argp->timestamp);
|
||||
printf("\n");
|
||||
__os_free(argp, 0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__txn_ckp_read(dbenv, recbuf, argpp)
|
||||
DB_ENV *dbenv;
|
||||
void *recbuf;
|
||||
__txn_ckp_args **argpp;
|
||||
{
|
||||
__txn_ckp_args *argp;
|
||||
u_int8_t *bp;
|
||||
int ret;
|
||||
|
||||
ret = __os_malloc(dbenv, sizeof(__txn_ckp_args) +
|
||||
sizeof(DB_TXN), NULL, &argp);
|
||||
if (ret != 0)
|
||||
return (ret);
|
||||
argp->txnid = (DB_TXN *)&argp[1];
|
||||
bp = recbuf;
|
||||
memcpy(&argp->type, bp, sizeof(argp->type));
|
||||
bp += sizeof(argp->type);
|
||||
memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid));
|
||||
bp += sizeof(argp->txnid->txnid);
|
||||
memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
|
||||
bp += sizeof(DB_LSN);
|
||||
memcpy(&argp->ckp_lsn, bp, sizeof(argp->ckp_lsn));
|
||||
bp += sizeof(argp->ckp_lsn);
|
||||
memcpy(&argp->last_ckp, bp, sizeof(argp->last_ckp));
|
||||
bp += sizeof(argp->last_ckp);
|
||||
memcpy(&argp->timestamp, bp, sizeof(argp->timestamp));
|
||||
bp += sizeof(argp->timestamp);
|
||||
*argpp = argp;
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__txn_xa_regop_old_print(dbenv, dbtp, lsnp, notused2, notused3)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops notused2;
|
||||
void *notused3;
|
||||
{
|
||||
__txn_xa_regop_old_args *argp;
|
||||
u_int32_t i;
|
||||
u_int ch;
|
||||
int ret;
|
||||
|
||||
i = 0;
|
||||
ch = 0;
|
||||
notused2 = DB_TXN_ABORT;
|
||||
notused3 = NULL;
|
||||
|
||||
if ((ret = __txn_xa_regop_old_read(dbenv, dbtp->data, &argp)) != 0)
|
||||
return (ret);
|
||||
printf("[%lu][%lu]txn_xa_regop_old: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
|
||||
(u_long)lsnp->file,
|
||||
(u_long)lsnp->offset,
|
||||
(u_long)argp->type,
|
||||
(u_long)argp->txnid->txnid,
|
||||
(u_long)argp->prev_lsn.file,
|
||||
(u_long)argp->prev_lsn.offset);
|
||||
printf("\topcode: %lu\n", (u_long)argp->opcode);
|
||||
printf("\txid: ");
|
||||
for (i = 0; i < argp->xid.size; i++) {
|
||||
ch = ((u_int8_t *)argp->xid.data)[i];
|
||||
if (isprint(ch) || ch == 0xa)
|
||||
putchar(ch);
|
||||
else
|
||||
printf("%#x ", ch);
|
||||
}
|
||||
printf("\n");
|
||||
printf("\tformatID: %ld\n", (long)argp->formatID);
|
||||
printf("\tgtrid: %u\n", argp->gtrid);
|
||||
printf("\tbqual: %u\n", argp->bqual);
|
||||
printf("\n");
|
||||
__os_free(argp, 0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__txn_xa_regop_old_read(dbenv, recbuf, argpp)
|
||||
DB_ENV *dbenv;
|
||||
void *recbuf;
|
||||
__txn_xa_regop_old_args **argpp;
|
||||
{
|
||||
__txn_xa_regop_old_args *argp;
|
||||
u_int8_t *bp;
|
||||
int ret;
|
||||
|
||||
ret = __os_malloc(dbenv, sizeof(__txn_xa_regop_old_args) +
|
||||
sizeof(DB_TXN), NULL, &argp);
|
||||
if (ret != 0)
|
||||
return (ret);
|
||||
argp->txnid = (DB_TXN *)&argp[1];
|
||||
bp = recbuf;
|
||||
memcpy(&argp->type, bp, sizeof(argp->type));
|
||||
bp += sizeof(argp->type);
|
||||
memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid));
|
||||
bp += sizeof(argp->txnid->txnid);
|
||||
memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
|
||||
bp += sizeof(DB_LSN);
|
||||
memcpy(&argp->opcode, bp, sizeof(argp->opcode));
|
||||
bp += sizeof(argp->opcode);
|
||||
memset(&argp->xid, 0, sizeof(argp->xid));
|
||||
memcpy(&argp->xid.size, bp, sizeof(u_int32_t));
|
||||
bp += sizeof(u_int32_t);
|
||||
argp->xid.data = bp;
|
||||
bp += argp->xid.size;
|
||||
memcpy(&argp->formatID, bp, sizeof(argp->formatID));
|
||||
bp += sizeof(argp->formatID);
|
||||
memcpy(&argp->gtrid, bp, sizeof(argp->gtrid));
|
||||
bp += sizeof(argp->gtrid);
|
||||
memcpy(&argp->bqual, bp, sizeof(argp->bqual));
|
||||
bp += sizeof(argp->bqual);
|
||||
*argpp = argp;
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__txn_xa_regop_log(dbenv, txnid, ret_lsnp, flags,
|
||||
opcode, xid, formatID, gtrid, bqual, begin_lsn)
|
||||
DB_ENV *dbenv;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN *ret_lsnp;
|
||||
u_int32_t flags;
|
||||
u_int32_t opcode;
|
||||
const DBT *xid;
|
||||
int32_t formatID;
|
||||
u_int32_t gtrid;
|
||||
u_int32_t bqual;
|
||||
DB_LSN * begin_lsn;
|
||||
{
|
||||
DBT logrec;
|
||||
DB_LSN *lsnp, null_lsn;
|
||||
u_int32_t zero;
|
||||
u_int32_t rectype, txn_num;
|
||||
int ret;
|
||||
u_int8_t *bp;
|
||||
|
||||
rectype = DB_txn_xa_regop;
|
||||
if (txnid != NULL &&
|
||||
TAILQ_FIRST(&txnid->kids) != NULL &&
|
||||
(ret = __txn_activekids(dbenv, rectype, txnid)) != 0)
|
||||
return (ret);
|
||||
txn_num = txnid == NULL ? 0 : txnid->txnid;
|
||||
if (txnid == NULL) {
|
||||
ZERO_LSN(null_lsn);
|
||||
lsnp = &null_lsn;
|
||||
} else
|
||||
lsnp = &txnid->last_lsn;
|
||||
logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
|
||||
+ sizeof(opcode)
|
||||
+ sizeof(u_int32_t) + (xid == NULL ? 0 : xid->size)
|
||||
+ sizeof(formatID)
|
||||
+ sizeof(gtrid)
|
||||
+ sizeof(bqual)
|
||||
+ sizeof(*begin_lsn);
|
||||
if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0)
|
||||
return (ret);
|
||||
|
||||
bp = logrec.data;
|
||||
memcpy(bp, &rectype, sizeof(rectype));
|
||||
bp += sizeof(rectype);
|
||||
memcpy(bp, &txn_num, sizeof(txn_num));
|
||||
bp += sizeof(txn_num);
|
||||
memcpy(bp, lsnp, sizeof(DB_LSN));
|
||||
bp += sizeof(DB_LSN);
|
||||
memcpy(bp, &opcode, sizeof(opcode));
|
||||
bp += sizeof(opcode);
|
||||
if (xid == NULL) {
|
||||
zero = 0;
|
||||
memcpy(bp, &zero, sizeof(u_int32_t));
|
||||
bp += sizeof(u_int32_t);
|
||||
} else {
|
||||
memcpy(bp, &xid->size, sizeof(xid->size));
|
||||
bp += sizeof(xid->size);
|
||||
memcpy(bp, xid->data, xid->size);
|
||||
bp += xid->size;
|
||||
}
|
||||
memcpy(bp, &formatID, sizeof(formatID));
|
||||
bp += sizeof(formatID);
|
||||
memcpy(bp, >rid, sizeof(gtrid));
|
||||
bp += sizeof(gtrid);
|
||||
memcpy(bp, &bqual, sizeof(bqual));
|
||||
bp += sizeof(bqual);
|
||||
if (begin_lsn != NULL)
|
||||
memcpy(bp, begin_lsn, sizeof(*begin_lsn));
|
||||
else
|
||||
memset(bp, 0, sizeof(*begin_lsn));
|
||||
bp += sizeof(*begin_lsn);
|
||||
DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size);
|
||||
ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags);
|
||||
if (txnid != NULL)
|
||||
txnid->last_lsn = *ret_lsnp;
|
||||
__os_free(logrec.data, logrec.size);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
int
|
||||
__txn_xa_regop_print(dbenv, dbtp, lsnp, notused2, notused3)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops notused2;
|
||||
void *notused3;
|
||||
{
|
||||
__txn_xa_regop_args *argp;
|
||||
u_int32_t i;
|
||||
u_int ch;
|
||||
int ret;
|
||||
|
||||
i = 0;
|
||||
ch = 0;
|
||||
notused2 = DB_TXN_ABORT;
|
||||
notused3 = NULL;
|
||||
|
||||
if ((ret = __txn_xa_regop_read(dbenv, dbtp->data, &argp)) != 0)
|
||||
return (ret);
|
||||
printf("[%lu][%lu]txn_xa_regop: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
|
||||
(u_long)lsnp->file,
|
||||
(u_long)lsnp->offset,
|
||||
(u_long)argp->type,
|
||||
(u_long)argp->txnid->txnid,
|
||||
(u_long)argp->prev_lsn.file,
|
||||
(u_long)argp->prev_lsn.offset);
|
||||
printf("\topcode: %lu\n", (u_long)argp->opcode);
|
||||
printf("\txid: ");
|
||||
for (i = 0; i < argp->xid.size; i++) {
|
||||
ch = ((u_int8_t *)argp->xid.data)[i];
|
||||
if (isprint(ch) || ch == 0xa)
|
||||
putchar(ch);
|
||||
else
|
||||
printf("%#x ", ch);
|
||||
}
|
||||
printf("\n");
|
||||
printf("\tformatID: %ld\n", (long)argp->formatID);
|
||||
printf("\tgtrid: %u\n", argp->gtrid);
|
||||
printf("\tbqual: %u\n", argp->bqual);
|
||||
printf("\tbegin_lsn: [%lu][%lu]\n",
|
||||
(u_long)argp->begin_lsn.file, (u_long)argp->begin_lsn.offset);
|
||||
printf("\n");
|
||||
__os_free(argp, 0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__txn_xa_regop_read(dbenv, recbuf, argpp)
|
||||
DB_ENV *dbenv;
|
||||
void *recbuf;
|
||||
__txn_xa_regop_args **argpp;
|
||||
{
|
||||
__txn_xa_regop_args *argp;
|
||||
u_int8_t *bp;
|
||||
int ret;
|
||||
|
||||
ret = __os_malloc(dbenv, sizeof(__txn_xa_regop_args) +
|
||||
sizeof(DB_TXN), NULL, &argp);
|
||||
if (ret != 0)
|
||||
return (ret);
|
||||
argp->txnid = (DB_TXN *)&argp[1];
|
||||
bp = recbuf;
|
||||
memcpy(&argp->type, bp, sizeof(argp->type));
|
||||
bp += sizeof(argp->type);
|
||||
memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid));
|
||||
bp += sizeof(argp->txnid->txnid);
|
||||
memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
|
||||
bp += sizeof(DB_LSN);
|
||||
memcpy(&argp->opcode, bp, sizeof(argp->opcode));
|
||||
bp += sizeof(argp->opcode);
|
||||
memset(&argp->xid, 0, sizeof(argp->xid));
|
||||
memcpy(&argp->xid.size, bp, sizeof(u_int32_t));
|
||||
bp += sizeof(u_int32_t);
|
||||
argp->xid.data = bp;
|
||||
bp += argp->xid.size;
|
||||
memcpy(&argp->formatID, bp, sizeof(argp->formatID));
|
||||
bp += sizeof(argp->formatID);
|
||||
memcpy(&argp->gtrid, bp, sizeof(argp->gtrid));
|
||||
bp += sizeof(argp->gtrid);
|
||||
memcpy(&argp->bqual, bp, sizeof(argp->bqual));
|
||||
bp += sizeof(argp->bqual);
|
||||
memcpy(&argp->begin_lsn, bp, sizeof(argp->begin_lsn));
|
||||
bp += sizeof(argp->begin_lsn);
|
||||
*argpp = argp;
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__txn_child_old_print(dbenv, dbtp, lsnp, notused2, notused3)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops notused2;
|
||||
void *notused3;
|
||||
{
|
||||
__txn_child_old_args *argp;
|
||||
u_int32_t i;
|
||||
u_int ch;
|
||||
int ret;
|
||||
|
||||
i = 0;
|
||||
ch = 0;
|
||||
notused2 = DB_TXN_ABORT;
|
||||
notused3 = NULL;
|
||||
|
||||
if ((ret = __txn_child_old_read(dbenv, dbtp->data, &argp)) != 0)
|
||||
return (ret);
|
||||
printf("[%lu][%lu]txn_child_old: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
|
||||
(u_long)lsnp->file,
|
||||
(u_long)lsnp->offset,
|
||||
(u_long)argp->type,
|
||||
(u_long)argp->txnid->txnid,
|
||||
(u_long)argp->prev_lsn.file,
|
||||
(u_long)argp->prev_lsn.offset);
|
||||
printf("\topcode: %lu\n", (u_long)argp->opcode);
|
||||
printf("\tparent: 0x%lx\n", (u_long)argp->parent);
|
||||
printf("\n");
|
||||
__os_free(argp, 0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__txn_child_old_read(dbenv, recbuf, argpp)
|
||||
DB_ENV *dbenv;
|
||||
void *recbuf;
|
||||
__txn_child_old_args **argpp;
|
||||
{
|
||||
__txn_child_old_args *argp;
|
||||
u_int8_t *bp;
|
||||
int ret;
|
||||
|
||||
ret = __os_malloc(dbenv, sizeof(__txn_child_old_args) +
|
||||
sizeof(DB_TXN), NULL, &argp);
|
||||
if (ret != 0)
|
||||
return (ret);
|
||||
argp->txnid = (DB_TXN *)&argp[1];
|
||||
bp = recbuf;
|
||||
memcpy(&argp->type, bp, sizeof(argp->type));
|
||||
bp += sizeof(argp->type);
|
||||
memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid));
|
||||
bp += sizeof(argp->txnid->txnid);
|
||||
memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
|
||||
bp += sizeof(DB_LSN);
|
||||
memcpy(&argp->opcode, bp, sizeof(argp->opcode));
|
||||
bp += sizeof(argp->opcode);
|
||||
memcpy(&argp->parent, bp, sizeof(argp->parent));
|
||||
bp += sizeof(argp->parent);
|
||||
*argpp = argp;
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__txn_child_log(dbenv, txnid, ret_lsnp, flags,
|
||||
child, c_lsn)
|
||||
DB_ENV *dbenv;
|
||||
DB_TXN *txnid;
|
||||
DB_LSN *ret_lsnp;
|
||||
u_int32_t flags;
|
||||
u_int32_t child;
|
||||
DB_LSN * c_lsn;
|
||||
{
|
||||
DBT logrec;
|
||||
DB_LSN *lsnp, null_lsn;
|
||||
u_int32_t rectype, txn_num;
|
||||
int ret;
|
||||
u_int8_t *bp;
|
||||
|
||||
rectype = DB_txn_child;
|
||||
if (txnid != NULL &&
|
||||
TAILQ_FIRST(&txnid->kids) != NULL &&
|
||||
(ret = __txn_activekids(dbenv, rectype, txnid)) != 0)
|
||||
return (ret);
|
||||
txn_num = txnid == NULL ? 0 : txnid->txnid;
|
||||
if (txnid == NULL) {
|
||||
ZERO_LSN(null_lsn);
|
||||
lsnp = &null_lsn;
|
||||
} else
|
||||
lsnp = &txnid->last_lsn;
|
||||
logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
|
||||
+ sizeof(child)
|
||||
+ sizeof(*c_lsn);
|
||||
if ((ret = __os_malloc(dbenv, logrec.size, NULL, &logrec.data)) != 0)
|
||||
return (ret);
|
||||
|
||||
bp = logrec.data;
|
||||
memcpy(bp, &rectype, sizeof(rectype));
|
||||
bp += sizeof(rectype);
|
||||
memcpy(bp, &txn_num, sizeof(txn_num));
|
||||
bp += sizeof(txn_num);
|
||||
memcpy(bp, lsnp, sizeof(DB_LSN));
|
||||
bp += sizeof(DB_LSN);
|
||||
memcpy(bp, &child, sizeof(child));
|
||||
bp += sizeof(child);
|
||||
if (c_lsn != NULL)
|
||||
memcpy(bp, c_lsn, sizeof(*c_lsn));
|
||||
else
|
||||
memset(bp, 0, sizeof(*c_lsn));
|
||||
bp += sizeof(*c_lsn);
|
||||
DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) == logrec.size);
|
||||
ret = log_put(dbenv, ret_lsnp, (DBT *)&logrec, flags);
|
||||
if (txnid != NULL)
|
||||
txnid->last_lsn = *ret_lsnp;
|
||||
__os_free(logrec.data, logrec.size);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
int
|
||||
__txn_child_print(dbenv, dbtp, lsnp, notused2, notused3)
|
||||
DB_ENV *dbenv;
|
||||
DBT *dbtp;
|
||||
DB_LSN *lsnp;
|
||||
db_recops notused2;
|
||||
void *notused3;
|
||||
{
|
||||
__txn_child_args *argp;
|
||||
u_int32_t i;
|
||||
u_int ch;
|
||||
int ret;
|
||||
|
||||
i = 0;
|
||||
ch = 0;
|
||||
notused2 = DB_TXN_ABORT;
|
||||
notused3 = NULL;
|
||||
|
||||
if ((ret = __txn_child_read(dbenv, dbtp->data, &argp)) != 0)
|
||||
return (ret);
|
||||
printf("[%lu][%lu]txn_child: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
|
||||
(u_long)lsnp->file,
|
||||
(u_long)lsnp->offset,
|
||||
(u_long)argp->type,
|
||||
(u_long)argp->txnid->txnid,
|
||||
(u_long)argp->prev_lsn.file,
|
||||
(u_long)argp->prev_lsn.offset);
|
||||
printf("\tchild: 0x%lx\n", (u_long)argp->child);
|
||||
printf("\tc_lsn: [%lu][%lu]\n",
|
||||
(u_long)argp->c_lsn.file, (u_long)argp->c_lsn.offset);
|
||||
printf("\n");
|
||||
__os_free(argp, 0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__txn_child_read(dbenv, recbuf, argpp)
|
||||
DB_ENV *dbenv;
|
||||
void *recbuf;
|
||||
__txn_child_args **argpp;
|
||||
{
|
||||
__txn_child_args *argp;
|
||||
u_int8_t *bp;
|
||||
int ret;
|
||||
|
||||
ret = __os_malloc(dbenv, sizeof(__txn_child_args) +
|
||||
sizeof(DB_TXN), NULL, &argp);
|
||||
if (ret != 0)
|
||||
return (ret);
|
||||
argp->txnid = (DB_TXN *)&argp[1];
|
||||
bp = recbuf;
|
||||
memcpy(&argp->type, bp, sizeof(argp->type));
|
||||
bp += sizeof(argp->type);
|
||||
memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid));
|
||||
bp += sizeof(argp->txnid->txnid);
|
||||
memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
|
||||
bp += sizeof(DB_LSN);
|
||||
memcpy(&argp->child, bp, sizeof(argp->child));
|
||||
bp += sizeof(argp->child);
|
||||
memcpy(&argp->c_lsn, bp, sizeof(argp->c_lsn));
|
||||
bp += sizeof(argp->c_lsn);
|
||||
*argpp = argp;
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__txn_init_print(dbenv)
|
||||
DB_ENV *dbenv;
|
||||
{
|
||||
int ret;
|
||||
|
||||
if ((ret = __db_add_recovery(dbenv,
|
||||
__txn_old_regop_print, DB_txn_old_regop)) != 0)
|
||||
return (ret);
|
||||
if ((ret = __db_add_recovery(dbenv,
|
||||
__txn_regop_print, DB_txn_regop)) != 0)
|
||||
return (ret);
|
||||
if ((ret = __db_add_recovery(dbenv,
|
||||
__txn_old_ckp_print, DB_txn_old_ckp)) != 0)
|
||||
return (ret);
|
||||
if ((ret = __db_add_recovery(dbenv,
|
||||
__txn_ckp_print, DB_txn_ckp)) != 0)
|
||||
return (ret);
|
||||
if ((ret = __db_add_recovery(dbenv,
|
||||
__txn_xa_regop_old_print, DB_txn_xa_regop_old)) != 0)
|
||||
return (ret);
|
||||
if ((ret = __db_add_recovery(dbenv,
|
||||
__txn_xa_regop_print, DB_txn_xa_regop)) != 0)
|
||||
return (ret);
|
||||
if ((ret = __db_add_recovery(dbenv,
|
||||
__txn_child_old_print, DB_txn_child_old)) != 0)
|
||||
return (ret);
|
||||
if ((ret = __db_add_recovery(dbenv,
|
||||
__txn_child_print, DB_txn_child)) != 0)
|
||||
return (ret);
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
__txn_init_recover(dbenv)
|
||||
DB_ENV *dbenv;
|
||||
{
|
||||
int ret;
|
||||
|
||||
if ((ret = __db_add_recovery(dbenv,
|
||||
__deprecated_recover, DB_txn_old_regop)) != 0)
|
||||
return (ret);
|
||||
if ((ret = __db_add_recovery(dbenv,
|
||||
__txn_regop_recover, DB_txn_regop)) != 0)
|
||||
return (ret);
|
||||
if ((ret = __db_add_recovery(dbenv,
|
||||
__deprecated_recover, DB_txn_old_ckp)) != 0)
|
||||
return (ret);
|
||||
if ((ret = __db_add_recovery(dbenv,
|
||||
__txn_ckp_recover, DB_txn_ckp)) != 0)
|
||||
return (ret);
|
||||
if ((ret = __db_add_recovery(dbenv,
|
||||
__deprecated_recover, DB_txn_xa_regop_old)) != 0)
|
||||
return (ret);
|
||||
if ((ret = __db_add_recovery(dbenv,
|
||||
__txn_xa_regop_recover, DB_txn_xa_regop)) != 0)
|
||||
return (ret);
|
||||
if ((ret = __db_add_recovery(dbenv,
|
||||
__deprecated_recover, DB_txn_child_old)) != 0)
|
||||
return (ret);
|
||||
if ((ret = __db_add_recovery(dbenv,
|
||||
__txn_child_recover, DB_txn_child)) != 0)
|
||||
return (ret);
|
||||
return (0);
|
||||
}
|
||||
|
Loading…
Reference in a new issue