mirror of
https://github.com/MariaDB/server.git
synced 2026-05-02 13:15:32 +02: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
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;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue