00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef _DB_AM_H
00010 #define _DB_AM_H
00011
00012 #define DB_MINPAGECACHE 10
00013
00014 #define DB_ISBIG 0x01
00015 #define DB_ISSUBDB 0x02
00016 #define DB_ADD_DUP 0x10
00017 #define DB_REM_DUP 0x20
00018 #define DB_ADD_BIG 0x30
00019 #define DB_REM_BIG 0x40
00020 #define DB_SPLITOLD 0x50
00021 #define DB_SPLITNEW 0x60
00022 #define DB_ADD_PAGE 0x70
00023 #define DB_REM_PAGE 0x80
00024 #define DB_LOG_CREATE 0x90
00025 #define DB_LOG_DELETE 0xa0
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #define __db_pg_alloc_log CDB___bam_pg_alloc_log
00037 #define __db_pg_free_log CDB___bam_pg_free_log
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 #define REC_INTRO(func, inc_count) { \
00049 file_dbp = NULL; \
00050 dbc = NULL; \
00051 if ((ret = func(dbenv, dbtp->data, &argp)) != 0) \
00052 goto out; \
00053 if ((ret = CDB___db_fileid_to_db(dbenv, \
00054 &file_dbp, argp->fileid, inc_count)) != 0) { \
00055 if (ret == DB_DELETED) { \
00056 ret = 0; \
00057 goto done; \
00058 } \
00059 goto out; \
00060 } \
00061 if (file_dbp == NULL) \
00062 goto out; \
00063 if ((ret = file_dbp->cursor(file_dbp, NULL, &dbc, 0)) != 0) \
00064 goto out; \
00065 F_SET(dbc, DBC_RECOVER); \
00066 mpf = file_dbp->mpf; \
00067 }
00068
00069 #define REC_CLOSE \
00070 if (argp != NULL) \
00071 CDB___os_free(argp, sizeof(*argp)); \
00072 if (dbc != NULL) \
00073 dbc->c_close(dbc); \
00074 return (ret);
00075
00076
00077
00078
00079 #define REC_NOOP_INTRO(func) { \
00080 if ((ret = func(dbenv, dbtp->data, &argp)) != 0) \
00081 return (ret); \
00082 }
00083 #define REC_NOOP_CLOSE \
00084 if (argp != NULL) \
00085 CDB___os_free(argp, sizeof(*argp)); \
00086 return (ret); \
00087
00088
00089
00090
00091 #ifdef DEBUG_RECOVER
00092 #define REC_PRINT(func) \
00093 (void)func(dbenv, dbtp, lsnp, redo, info);
00094 #else
00095 #define REC_PRINT(func)
00096 #endif
00097
00098
00099
00100
00101 #define LCK_COUPLE 0x01
00102 #define LCK_ALWAYS 0x02
00103 #define LCK_ROLLBACK 0x04
00104
00105
00106
00107
00108
00109
00110
00111 #define __LPUT(dbc, lock) \
00112 (lock.off != LOCK_INVALID ? \
00113 CDB_lock_put((dbc)->dbp->dbenv, &(lock)) : 0)
00114 #define __TLPUT(dbc, lock) \
00115 (lock.off != LOCK_INVALID && \
00116 (dbc)->txn == NULL ? CDB_lock_put((dbc)->dbp->dbenv, &(lock)) : 0)
00117
00118 #include "db_auto.h"
00119 #include "crdel_auto.h"
00120 #include "db_ext.h"
00121 #endif