00001
00002
00003 #include "db_config.h"
00004
00005 #ifndef NO_SYSTEM_INCLUDES
00006 #include <sys/types.h>
00007
00008 #include <ctype.h>
00009 #include <string.h>
00010 #endif
00011
00012 #include "db_int.h"
00013 #include "dbinc/crypto.h"
00014 #include "dbinc/db_page.h"
00015 #include "dbinc/db_am.h"
00016 #include "dbinc/log.h"
00017 #include "dbinc/txn.h"
00018 #include "dbinc/fop.h"
00019
00020
00021
00022
00023
00024 int
00025 __fop_create_print(dbenv, dbtp, lsnp, notused2, notused3)
00026 DB_ENV *dbenv;
00027 DBT *dbtp;
00028 DB_LSN *lsnp;
00029 db_recops notused2;
00030 void *notused3;
00031 {
00032 __fop_create_args *argp;
00033 u_int32_t i;
00034 int ch;
00035 int ret;
00036
00037 notused2 = DB_TXN_PRINT;
00038 notused3 = NULL;
00039
00040 if ((ret = __fop_create_read(dbenv, dbtp->data, &argp)) != 0)
00041 return (ret);
00042 (void)printf(
00043 "[%lu][%lu]__fop_create%s: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
00044 (u_long)lsnp->file,
00045 (u_long)lsnp->offset,
00046 (argp->type & DB_debug_FLAG) ? "_debug" : "",
00047 (u_long)argp->type,
00048 (u_long)argp->txnid->txnid,
00049 (u_long)argp->prev_lsn.file,
00050 (u_long)argp->prev_lsn.offset);
00051 (void)printf("\tname: ");
00052 for (i = 0; i < argp->name.size; i++) {
00053 ch = ((u_int8_t *)argp->name.data)[i];
00054 printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
00055 }
00056 (void)printf("\n");
00057 (void)printf("\tappname: %lu\n", (u_long)argp->appname);
00058 (void)printf("\tmode: %o\n", argp->mode);
00059 (void)printf("\n");
00060 __os_free(dbenv, argp);
00061 return (0);
00062 }
00063
00064
00065
00066
00067
00068 int
00069 __fop_remove_print(dbenv, dbtp, lsnp, notused2, notused3)
00070 DB_ENV *dbenv;
00071 DBT *dbtp;
00072 DB_LSN *lsnp;
00073 db_recops notused2;
00074 void *notused3;
00075 {
00076 __fop_remove_args *argp;
00077 u_int32_t i;
00078 int ch;
00079 int ret;
00080
00081 notused2 = DB_TXN_PRINT;
00082 notused3 = NULL;
00083
00084 if ((ret = __fop_remove_read(dbenv, dbtp->data, &argp)) != 0)
00085 return (ret);
00086 (void)printf(
00087 "[%lu][%lu]__fop_remove%s: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
00088 (u_long)lsnp->file,
00089 (u_long)lsnp->offset,
00090 (argp->type & DB_debug_FLAG) ? "_debug" : "",
00091 (u_long)argp->type,
00092 (u_long)argp->txnid->txnid,
00093 (u_long)argp->prev_lsn.file,
00094 (u_long)argp->prev_lsn.offset);
00095 (void)printf("\tname: ");
00096 for (i = 0; i < argp->name.size; i++) {
00097 ch = ((u_int8_t *)argp->name.data)[i];
00098 printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
00099 }
00100 (void)printf("\n");
00101 (void)printf("\tfid: ");
00102 for (i = 0; i < argp->fid.size; i++) {
00103 ch = ((u_int8_t *)argp->fid.data)[i];
00104 printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
00105 }
00106 (void)printf("\n");
00107 (void)printf("\tappname: %lu\n", (u_long)argp->appname);
00108 (void)printf("\n");
00109 __os_free(dbenv, argp);
00110 return (0);
00111 }
00112
00113
00114
00115
00116
00117 int
00118 __fop_write_print(dbenv, dbtp, lsnp, notused2, notused3)
00119 DB_ENV *dbenv;
00120 DBT *dbtp;
00121 DB_LSN *lsnp;
00122 db_recops notused2;
00123 void *notused3;
00124 {
00125 __fop_write_args *argp;
00126 u_int32_t i;
00127 int ch;
00128 int ret;
00129
00130 notused2 = DB_TXN_PRINT;
00131 notused3 = NULL;
00132
00133 if ((ret = __fop_write_read(dbenv, dbtp->data, &argp)) != 0)
00134 return (ret);
00135 (void)printf(
00136 "[%lu][%lu]__fop_write%s: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
00137 (u_long)lsnp->file,
00138 (u_long)lsnp->offset,
00139 (argp->type & DB_debug_FLAG) ? "_debug" : "",
00140 (u_long)argp->type,
00141 (u_long)argp->txnid->txnid,
00142 (u_long)argp->prev_lsn.file,
00143 (u_long)argp->prev_lsn.offset);
00144 (void)printf("\tname: ");
00145 for (i = 0; i < argp->name.size; i++) {
00146 ch = ((u_int8_t *)argp->name.data)[i];
00147 printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
00148 }
00149 (void)printf("\n");
00150 (void)printf("\tappname: %lu\n", (u_long)argp->appname);
00151 (void)printf("\tpgsize: %lu\n", (u_long)argp->pgsize);
00152 (void)printf("\tpageno: %lu\n", (u_long)argp->pageno);
00153 (void)printf("\toffset: %lu\n", (u_long)argp->offset);
00154 (void)printf("\tpage: ");
00155 for (i = 0; i < argp->page.size; i++) {
00156 ch = ((u_int8_t *)argp->page.data)[i];
00157 printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
00158 }
00159 (void)printf("\n");
00160 (void)printf("\tflag: %lu\n", (u_long)argp->flag);
00161 (void)printf("\n");
00162 __os_free(dbenv, argp);
00163 return (0);
00164 }
00165
00166
00167
00168
00169
00170 int
00171 __fop_rename_print(dbenv, dbtp, lsnp, notused2, notused3)
00172 DB_ENV *dbenv;
00173 DBT *dbtp;
00174 DB_LSN *lsnp;
00175 db_recops notused2;
00176 void *notused3;
00177 {
00178 __fop_rename_args *argp;
00179 u_int32_t i;
00180 int ch;
00181 int ret;
00182
00183 notused2 = DB_TXN_PRINT;
00184 notused3 = NULL;
00185
00186 if ((ret = __fop_rename_read(dbenv, dbtp->data, &argp)) != 0)
00187 return (ret);
00188 (void)printf(
00189 "[%lu][%lu]__fop_rename%s: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
00190 (u_long)lsnp->file,
00191 (u_long)lsnp->offset,
00192 (argp->type & DB_debug_FLAG) ? "_debug" : "",
00193 (u_long)argp->type,
00194 (u_long)argp->txnid->txnid,
00195 (u_long)argp->prev_lsn.file,
00196 (u_long)argp->prev_lsn.offset);
00197 (void)printf("\toldname: ");
00198 for (i = 0; i < argp->oldname.size; i++) {
00199 ch = ((u_int8_t *)argp->oldname.data)[i];
00200 printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
00201 }
00202 (void)printf("\n");
00203 (void)printf("\tnewname: ");
00204 for (i = 0; i < argp->newname.size; i++) {
00205 ch = ((u_int8_t *)argp->newname.data)[i];
00206 printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
00207 }
00208 (void)printf("\n");
00209 (void)printf("\tfileid: ");
00210 for (i = 0; i < argp->fileid.size; i++) {
00211 ch = ((u_int8_t *)argp->fileid.data)[i];
00212 printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
00213 }
00214 (void)printf("\n");
00215 (void)printf("\tappname: %lu\n", (u_long)argp->appname);
00216 (void)printf("\n");
00217 __os_free(dbenv, argp);
00218 return (0);
00219 }
00220
00221
00222
00223
00224
00225 int
00226 __fop_file_remove_print(dbenv, dbtp, lsnp, notused2, notused3)
00227 DB_ENV *dbenv;
00228 DBT *dbtp;
00229 DB_LSN *lsnp;
00230 db_recops notused2;
00231 void *notused3;
00232 {
00233 __fop_file_remove_args *argp;
00234 u_int32_t i;
00235 int ch;
00236 int ret;
00237
00238 notused2 = DB_TXN_PRINT;
00239 notused3 = NULL;
00240
00241 if ((ret = __fop_file_remove_read(dbenv, dbtp->data, &argp)) != 0)
00242 return (ret);
00243 (void)printf(
00244 "[%lu][%lu]__fop_file_remove%s: rec: %lu txnid %lx prevlsn [%lu][%lu]\n",
00245 (u_long)lsnp->file,
00246 (u_long)lsnp->offset,
00247 (argp->type & DB_debug_FLAG) ? "_debug" : "",
00248 (u_long)argp->type,
00249 (u_long)argp->txnid->txnid,
00250 (u_long)argp->prev_lsn.file,
00251 (u_long)argp->prev_lsn.offset);
00252 (void)printf("\treal_fid: ");
00253 for (i = 0; i < argp->real_fid.size; i++) {
00254 ch = ((u_int8_t *)argp->real_fid.data)[i];
00255 printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
00256 }
00257 (void)printf("\n");
00258 (void)printf("\ttmp_fid: ");
00259 for (i = 0; i < argp->tmp_fid.size; i++) {
00260 ch = ((u_int8_t *)argp->tmp_fid.data)[i];
00261 printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
00262 }
00263 (void)printf("\n");
00264 (void)printf("\tname: ");
00265 for (i = 0; i < argp->name.size; i++) {
00266 ch = ((u_int8_t *)argp->name.data)[i];
00267 printf(isprint(ch) || ch == 0x0a ? "%c" : "%#x ", ch);
00268 }
00269 (void)printf("\n");
00270 (void)printf("\tappname: %lu\n", (u_long)argp->appname);
00271 (void)printf("\tchild: 0x%lx\n", (u_long)argp->child);
00272 (void)printf("\n");
00273 __os_free(dbenv, argp);
00274 return (0);
00275 }
00276
00277
00278
00279
00280
00281 int
00282 __fop_init_print(dbenv, dtabp, dtabsizep)
00283 DB_ENV *dbenv;
00284 int (***dtabp)__P((DB_ENV *, DBT *, DB_LSN *, db_recops, void *));
00285 size_t *dtabsizep;
00286 {
00287 int ret;
00288
00289 if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
00290 __fop_create_print, DB___fop_create)) != 0)
00291 return (ret);
00292 if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
00293 __fop_remove_print, DB___fop_remove)) != 0)
00294 return (ret);
00295 if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
00296 __fop_write_print, DB___fop_write)) != 0)
00297 return (ret);
00298 if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
00299 __fop_rename_print, DB___fop_rename)) != 0)
00300 return (ret);
00301 if ((ret = __db_add_recovery(dbenv, dtabp, dtabsizep,
00302 __fop_file_remove_print, DB___fop_file_remove)) != 0)
00303 return (ret);
00304 return (0);
00305 }