rec_btree
上传用户:tsgydb
上传日期:2007-04-14
资源大小:10674k
文件大小:19k
- #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;
- }