diff options
Diffstat (limited to 'bdb/dist')
-rw-r--r-- | bdb/dist/template/rec_dbreg | 75 | ||||
-rw-r--r-- | bdb/dist/template/rec_fileops | 323 |
2 files changed, 0 insertions, 398 deletions
diff --git a/bdb/dist/template/rec_dbreg b/bdb/dist/template/rec_dbreg deleted file mode 100644 index bbdf19d5ffc..00000000000 --- a/bdb/dist/template/rec_dbreg +++ /dev/null @@ -1,75 +0,0 @@ -#include "db_config.h" - -#ifndef NO_SYSTEM_INCLUDES -#include <sys/types.h> - -#include <string.h> -#endif - -#include "db_int.h" -#include "dbinc/db_page.h" -#include "dbinc/__dbreg.h" -#include "dbinc/log.h" - -/* - * __dbreg_register_recover -- - * Recovery function for register. - * - * PUBLIC: int __dbreg_register_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__dbreg_register_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __dbreg_register_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__dbreg_register_print); - REC_INTRO(__dbreg_register_read, 1); - - if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = mpf->get(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 = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - diff --git a/bdb/dist/template/rec_fileops b/bdb/dist/template/rec_fileops deleted file mode 100644 index c1487835ea9..00000000000 --- a/bdb/dist/template/rec_fileops +++ /dev/null @@ -1,323 +0,0 @@ -#include "db_config.h" - -#ifndef NO_SYSTEM_INCLUDES -#include <sys/types.h> - -#include <string.h> -#endif - -#include "db_int.h" -#include "dbinc/db_page.h" -#include "dbinc/__fop.h" -#include "dbinc/log.h" - -/* - * __fop_create_recover -- - * Recovery function for create. - * - * PUBLIC: int __fop_create_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__fop_create_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __fop_create_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__fop_create_print); - REC_INTRO(__fop_create_read, 1); - - if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = mpf->get(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 = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __fop_remove_recover -- - * Recovery function for remove. - * - * PUBLIC: int __fop_remove_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__fop_remove_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __fop_remove_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__fop_remove_print); - REC_INTRO(__fop_remove_read, 1); - - if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = mpf->get(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 = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __fop_write_recover -- - * Recovery function for write. - * - * PUBLIC: int __fop_write_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__fop_write_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __fop_write_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__fop_write_print); - REC_INTRO(__fop_write_read, 1); - - if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = mpf->get(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 = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __fop_rename_recover -- - * Recovery function for rename. - * - * PUBLIC: int __fop_rename_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__fop_rename_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __fop_rename_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__fop_rename_print); - REC_INTRO(__fop_rename_read, 1); - - if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = mpf->get(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 = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - -/* - * __fop_file_remove_recover -- - * Recovery function for file_remove. - * - * PUBLIC: int __fop_file_remove_recover - * PUBLIC: __P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *)); - */ -int -__fop_file_remove_recover(dbenv, dbtp, lsnp, op, info) - DB_ENV *dbenv; - DBT *dbtp; - DB_LSN *lsnp; - db_recops op; - void *info; -{ - __fop_file_remove_args *argp; - DB *file_dbp; - DBC *dbc; - DB_MPOOLFILE *mpf; - PAGE *pagep; - int cmp_n, cmp_p, modified, ret; - - REC_PRINT(__fop_file_remove_print); - REC_INTRO(__fop_file_remove_read, 1); - - if ((ret = mpf->get(mpf, &argp->pgno, 0, &pagep)) != 0) - if (DB_REDO(op)) { - if ((ret = mpf->get(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 = mpf->put(mpf, pagep, modified ? DB_MPOOL_DIRTY : 0)) - goto out; - - *lsnp = argp->prev_lsn; - ret = 0; - -out: REC_CLOSE; -} - |