summaryrefslogtreecommitdiff
path: root/db/fileops/fileops_auto.c
diff options
context:
space:
mode:
Diffstat (limited to 'db/fileops/fileops_auto.c')
-rw-r--r--db/fileops/fileops_auto.c238
1 files changed, 125 insertions, 113 deletions
diff --git a/db/fileops/fileops_auto.c b/db/fileops/fileops_auto.c
index 333e37755..0da353b2b 100644
--- a/db/fileops/fileops_auto.c
+++ b/db/fileops/fileops_auto.c
@@ -2,17 +2,9 @@
#include "db_config.h"
-#ifndef NO_SYSTEM_INCLUDES
-#include <sys/types.h>
-
-#include <ctype.h>
-#include <string.h>
-#endif
-
#include "db_int.h"
#include "dbinc/crypto.h"
#include "dbinc/db_page.h"
-#include "dbinc/db_dispatch.h"
#include "dbinc/db_am.h"
#include "dbinc/log.h"
#include "dbinc/txn.h"
@@ -23,10 +15,10 @@
* PUBLIC: u_int32_t, const DBT *, u_int32_t, u_int32_t));
*/
int
-__fop_create_log(dbenv, txnid, ret_lsnp, flags,
+__fop_create_log(dbenv, txnp, ret_lsnp, flags,
name, appname, mode)
DB_ENV *dbenv;
- DB_TXN *txnid;
+ DB_TXN *txnp;
DB_LSN *ret_lsnp;
u_int32_t flags;
const DBT *name;
@@ -50,29 +42,30 @@ __fop_create_log(dbenv, txnid, ret_lsnp, flags,
ret = 0;
if (LF_ISSET(DB_LOG_NOT_DURABLE)) {
- if (txnid == NULL)
+ if (txnp == NULL)
+ return (0);
+ if (txnp == NULL)
return (0);
is_durable = 0;
} else
is_durable = 1;
- if (txnid == NULL) {
+ if (txnp == NULL) {
txn_num = 0;
lsnp = &null_lsn;
null_lsn.file = null_lsn.offset = 0;
} else {
- if (TAILQ_FIRST(&txnid->kids) != NULL &&
- (ret = __txn_activekids(dbenv, rectype, txnid)) != 0)
+ if (TAILQ_FIRST(&txnp->kids) != NULL &&
+ (ret = __txn_activekids(dbenv, rectype, txnp)) != 0)
return (ret);
/*
* We need to assign begin_lsn while holding region mutex.
* That assignment is done inside the DbEnv->log_put call,
* so pass in the appropriate memory location to be filled
* in by the log_put code.
- */
- DB_SET_BEGIN_LSNP(txnid, &rlsnp);
- txn_num = txnid->txnid;
- lsnp = &txnid->last_lsn;
+ */
+ DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
+ txn_num = txnp->txnid;
}
logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
@@ -85,7 +78,7 @@ __fop_create_log(dbenv, txnid, ret_lsnp, flags,
logrec.size += npad;
}
- if (is_durable || txnid == NULL) {
+ if (is_durable || txnp == NULL) {
if ((ret =
__os_malloc(dbenv, logrec.size, &logrec.data)) != 0)
return (ret);
@@ -136,12 +129,13 @@ __fop_create_log(dbenv, txnid, ret_lsnp, flags,
memcpy(bp, &uinttmp, sizeof(uinttmp));
bp += sizeof(uinttmp);
- DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
+ DB_ASSERT(dbenv,
+ (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
- if (is_durable || txnid == NULL) {
+ if (is_durable || txnp == NULL) {
if ((ret = __log_put(dbenv, rlsnp,(DBT *)&logrec,
- flags | DB_LOG_NOCOPY)) == 0 && txnid != NULL) {
- txnid->last_lsn = *rlsnp;
+ flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
+ *lsnp = *rlsnp;
if (rlsnp != ret_lsnp)
*ret_lsnp = *rlsnp;
}
@@ -160,20 +154,21 @@ __fop_create_log(dbenv, txnid, ret_lsnp, flags,
#else
ret = 0;
#endif
- STAILQ_INSERT_HEAD(&txnid->logs, lr, links);
+ STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
+ F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
LSN_NOT_LOGGED(*ret_lsnp);
}
#ifdef LOG_DIAGNOSTIC
if (ret != 0)
(void)__fop_create_print(dbenv,
- (DBT *)&logrec, ret_lsnp, NULL, NULL);
+ (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
#endif
#ifdef DIAGNOSTIC
__os_free(dbenv, logrec.data);
#else
- if (is_durable || txnid == NULL)
+ if (is_durable || txnp == NULL)
__os_free(dbenv, logrec.data);
#endif
return (ret);
@@ -197,13 +192,14 @@ __fop_create_read(dbenv, recbuf, argpp)
sizeof(__fop_create_args) + sizeof(DB_TXN), &argp)) != 0)
return (ret);
bp = recbuf;
- argp->txnid = (DB_TXN *)&argp[1];
+ argp->txnp = (DB_TXN *)&argp[1];
+ memset(argp->txnp, 0, sizeof(DB_TXN));
memcpy(&argp->type, bp, sizeof(argp->type));
bp += sizeof(argp->type);
- memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid));
- bp += sizeof(argp->txnid->txnid);
+ memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid));
+ bp += sizeof(argp->txnp->txnid);
memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
bp += sizeof(DB_LSN);
@@ -231,10 +227,10 @@ __fop_create_read(dbenv, recbuf, argpp)
* PUBLIC: u_int32_t, const DBT *, const DBT *, u_int32_t));
*/
int
-__fop_remove_log(dbenv, txnid, ret_lsnp, flags,
+__fop_remove_log(dbenv, txnp, ret_lsnp, flags,
name, fid, appname)
DB_ENV *dbenv;
- DB_TXN *txnid;
+ DB_TXN *txnp;
DB_LSN *ret_lsnp;
u_int32_t flags;
const DBT *name;
@@ -258,29 +254,30 @@ __fop_remove_log(dbenv, txnid, ret_lsnp, flags,
ret = 0;
if (LF_ISSET(DB_LOG_NOT_DURABLE)) {
- if (txnid == NULL)
+ if (txnp == NULL)
+ return (0);
+ if (txnp == NULL)
return (0);
is_durable = 0;
} else
is_durable = 1;
- if (txnid == NULL) {
+ if (txnp == NULL) {
txn_num = 0;
lsnp = &null_lsn;
null_lsn.file = null_lsn.offset = 0;
} else {
- if (TAILQ_FIRST(&txnid->kids) != NULL &&
- (ret = __txn_activekids(dbenv, rectype, txnid)) != 0)
+ if (TAILQ_FIRST(&txnp->kids) != NULL &&
+ (ret = __txn_activekids(dbenv, rectype, txnp)) != 0)
return (ret);
/*
* We need to assign begin_lsn while holding region mutex.
* That assignment is done inside the DbEnv->log_put call,
* so pass in the appropriate memory location to be filled
* in by the log_put code.
- */
- DB_SET_BEGIN_LSNP(txnid, &rlsnp);
- txn_num = txnid->txnid;
- lsnp = &txnid->last_lsn;
+ */
+ DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
+ txn_num = txnp->txnid;
}
logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
@@ -293,7 +290,7 @@ __fop_remove_log(dbenv, txnid, ret_lsnp, flags,
logrec.size += npad;
}
- if (is_durable || txnid == NULL) {
+ if (is_durable || txnp == NULL) {
if ((ret =
__os_malloc(dbenv, logrec.size, &logrec.data)) != 0)
return (ret);
@@ -351,12 +348,13 @@ __fop_remove_log(dbenv, txnid, ret_lsnp, flags,
memcpy(bp, &uinttmp, sizeof(uinttmp));
bp += sizeof(uinttmp);
- DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
+ DB_ASSERT(dbenv,
+ (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
- if (is_durable || txnid == NULL) {
+ if (is_durable || txnp == NULL) {
if ((ret = __log_put(dbenv, rlsnp,(DBT *)&logrec,
- flags | DB_LOG_NOCOPY)) == 0 && txnid != NULL) {
- txnid->last_lsn = *rlsnp;
+ flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
+ *lsnp = *rlsnp;
if (rlsnp != ret_lsnp)
*ret_lsnp = *rlsnp;
}
@@ -375,20 +373,21 @@ __fop_remove_log(dbenv, txnid, ret_lsnp, flags,
#else
ret = 0;
#endif
- STAILQ_INSERT_HEAD(&txnid->logs, lr, links);
+ STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
+ F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
LSN_NOT_LOGGED(*ret_lsnp);
}
#ifdef LOG_DIAGNOSTIC
if (ret != 0)
(void)__fop_remove_print(dbenv,
- (DBT *)&logrec, ret_lsnp, NULL, NULL);
+ (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
#endif
#ifdef DIAGNOSTIC
__os_free(dbenv, logrec.data);
#else
- if (is_durable || txnid == NULL)
+ if (is_durable || txnp == NULL)
__os_free(dbenv, logrec.data);
#endif
return (ret);
@@ -412,13 +411,14 @@ __fop_remove_read(dbenv, recbuf, argpp)
sizeof(__fop_remove_args) + sizeof(DB_TXN), &argp)) != 0)
return (ret);
bp = recbuf;
- argp->txnid = (DB_TXN *)&argp[1];
+ argp->txnp = (DB_TXN *)&argp[1];
+ memset(argp->txnp, 0, sizeof(DB_TXN));
memcpy(&argp->type, bp, sizeof(argp->type));
bp += sizeof(argp->type);
- memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid));
- bp += sizeof(argp->txnid->txnid);
+ memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid));
+ bp += sizeof(argp->txnp->txnid);
memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
bp += sizeof(DB_LSN);
@@ -449,11 +449,11 @@ __fop_remove_read(dbenv, recbuf, argpp)
* PUBLIC: u_int32_t, const DBT *, u_int32_t));
*/
int
-__fop_write_log(dbenv, txnid, ret_lsnp, flags,
+__fop_write_log(dbenv, txnp, ret_lsnp, flags,
name, appname, pgsize, pageno, offset, page,
flag)
DB_ENV *dbenv;
- DB_TXN *txnid;
+ DB_TXN *txnp;
DB_LSN *ret_lsnp;
u_int32_t flags;
const DBT *name;
@@ -481,29 +481,30 @@ __fop_write_log(dbenv, txnid, ret_lsnp, flags,
ret = 0;
if (LF_ISSET(DB_LOG_NOT_DURABLE)) {
- if (txnid == NULL)
+ if (txnp == NULL)
+ return (0);
+ if (txnp == NULL)
return (0);
is_durable = 0;
} else
is_durable = 1;
- if (txnid == NULL) {
+ if (txnp == NULL) {
txn_num = 0;
lsnp = &null_lsn;
null_lsn.file = null_lsn.offset = 0;
} else {
- if (TAILQ_FIRST(&txnid->kids) != NULL &&
- (ret = __txn_activekids(dbenv, rectype, txnid)) != 0)
+ if (TAILQ_FIRST(&txnp->kids) != NULL &&
+ (ret = __txn_activekids(dbenv, rectype, txnp)) != 0)
return (ret);
/*
* We need to assign begin_lsn while holding region mutex.
* That assignment is done inside the DbEnv->log_put call,
* so pass in the appropriate memory location to be filled
* in by the log_put code.
- */
- DB_SET_BEGIN_LSNP(txnid, &rlsnp);
- txn_num = txnid->txnid;
- lsnp = &txnid->last_lsn;
+ */
+ DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
+ txn_num = txnp->txnid;
}
logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
@@ -520,7 +521,7 @@ __fop_write_log(dbenv, txnid, ret_lsnp, flags,
logrec.size += npad;
}
- if (is_durable || txnid == NULL) {
+ if (is_durable || txnp == NULL) {
if ((ret =
__os_malloc(dbenv, logrec.size, &logrec.data)) != 0)
return (ret);
@@ -594,12 +595,13 @@ __fop_write_log(dbenv, txnid, ret_lsnp, flags,
memcpy(bp, &uinttmp, sizeof(uinttmp));
bp += sizeof(uinttmp);
- DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
+ DB_ASSERT(dbenv,
+ (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
- if (is_durable || txnid == NULL) {
+ if (is_durable || txnp == NULL) {
if ((ret = __log_put(dbenv, rlsnp,(DBT *)&logrec,
- flags | DB_LOG_NOCOPY)) == 0 && txnid != NULL) {
- txnid->last_lsn = *rlsnp;
+ flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
+ *lsnp = *rlsnp;
if (rlsnp != ret_lsnp)
*ret_lsnp = *rlsnp;
}
@@ -618,20 +620,21 @@ __fop_write_log(dbenv, txnid, ret_lsnp, flags,
#else
ret = 0;
#endif
- STAILQ_INSERT_HEAD(&txnid->logs, lr, links);
+ STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
+ F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
LSN_NOT_LOGGED(*ret_lsnp);
}
#ifdef LOG_DIAGNOSTIC
if (ret != 0)
(void)__fop_write_print(dbenv,
- (DBT *)&logrec, ret_lsnp, NULL, NULL);
+ (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
#endif
#ifdef DIAGNOSTIC
__os_free(dbenv, logrec.data);
#else
- if (is_durable || txnid == NULL)
+ if (is_durable || txnp == NULL)
__os_free(dbenv, logrec.data);
#endif
return (ret);
@@ -655,13 +658,14 @@ __fop_write_read(dbenv, recbuf, argpp)
sizeof(__fop_write_args) + sizeof(DB_TXN), &argp)) != 0)
return (ret);
bp = recbuf;
- argp->txnid = (DB_TXN *)&argp[1];
+ argp->txnp = (DB_TXN *)&argp[1];
+ memset(argp->txnp, 0, sizeof(DB_TXN));
memcpy(&argp->type, bp, sizeof(argp->type));
bp += sizeof(argp->type);
- memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid));
- bp += sizeof(argp->txnid->txnid);
+ memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid));
+ bp += sizeof(argp->txnp->txnid);
memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
bp += sizeof(DB_LSN);
@@ -707,10 +711,10 @@ __fop_write_read(dbenv, recbuf, argpp)
* PUBLIC: u_int32_t, const DBT *, const DBT *, const DBT *, u_int32_t));
*/
int
-__fop_rename_log(dbenv, txnid, ret_lsnp, flags,
+__fop_rename_log(dbenv, txnp, ret_lsnp, flags,
oldname, newname, fileid, appname)
DB_ENV *dbenv;
- DB_TXN *txnid;
+ DB_TXN *txnp;
DB_LSN *ret_lsnp;
u_int32_t flags;
const DBT *oldname;
@@ -735,29 +739,30 @@ __fop_rename_log(dbenv, txnid, ret_lsnp, flags,
ret = 0;
if (LF_ISSET(DB_LOG_NOT_DURABLE)) {
- if (txnid == NULL)
+ if (txnp == NULL)
+ return (0);
+ if (txnp == NULL)
return (0);
is_durable = 0;
} else
is_durable = 1;
- if (txnid == NULL) {
+ if (txnp == NULL) {
txn_num = 0;
lsnp = &null_lsn;
null_lsn.file = null_lsn.offset = 0;
} else {
- if (TAILQ_FIRST(&txnid->kids) != NULL &&
- (ret = __txn_activekids(dbenv, rectype, txnid)) != 0)
+ if (TAILQ_FIRST(&txnp->kids) != NULL &&
+ (ret = __txn_activekids(dbenv, rectype, txnp)) != 0)
return (ret);
/*
* We need to assign begin_lsn while holding region mutex.
* That assignment is done inside the DbEnv->log_put call,
* so pass in the appropriate memory location to be filled
* in by the log_put code.
- */
- DB_SET_BEGIN_LSNP(txnid, &rlsnp);
- txn_num = txnid->txnid;
- lsnp = &txnid->last_lsn;
+ */
+ DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
+ txn_num = txnp->txnid;
}
logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
@@ -771,7 +776,7 @@ __fop_rename_log(dbenv, txnid, ret_lsnp, flags,
logrec.size += npad;
}
- if (is_durable || txnid == NULL) {
+ if (is_durable || txnp == NULL) {
if ((ret =
__os_malloc(dbenv, logrec.size, &logrec.data)) != 0)
return (ret);
@@ -840,12 +845,13 @@ __fop_rename_log(dbenv, txnid, ret_lsnp, flags,
memcpy(bp, &uinttmp, sizeof(uinttmp));
bp += sizeof(uinttmp);
- DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
+ DB_ASSERT(dbenv,
+ (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
- if (is_durable || txnid == NULL) {
+ if (is_durable || txnp == NULL) {
if ((ret = __log_put(dbenv, rlsnp,(DBT *)&logrec,
- flags | DB_LOG_NOCOPY)) == 0 && txnid != NULL) {
- txnid->last_lsn = *rlsnp;
+ flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
+ *lsnp = *rlsnp;
if (rlsnp != ret_lsnp)
*ret_lsnp = *rlsnp;
}
@@ -864,20 +870,21 @@ __fop_rename_log(dbenv, txnid, ret_lsnp, flags,
#else
ret = 0;
#endif
- STAILQ_INSERT_HEAD(&txnid->logs, lr, links);
+ STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
+ F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
LSN_NOT_LOGGED(*ret_lsnp);
}
#ifdef LOG_DIAGNOSTIC
if (ret != 0)
(void)__fop_rename_print(dbenv,
- (DBT *)&logrec, ret_lsnp, NULL, NULL);
+ (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
#endif
#ifdef DIAGNOSTIC
__os_free(dbenv, logrec.data);
#else
- if (is_durable || txnid == NULL)
+ if (is_durable || txnp == NULL)
__os_free(dbenv, logrec.data);
#endif
return (ret);
@@ -901,13 +908,14 @@ __fop_rename_read(dbenv, recbuf, argpp)
sizeof(__fop_rename_args) + sizeof(DB_TXN), &argp)) != 0)
return (ret);
bp = recbuf;
- argp->txnid = (DB_TXN *)&argp[1];
+ argp->txnp = (DB_TXN *)&argp[1];
+ memset(argp->txnp, 0, sizeof(DB_TXN));
memcpy(&argp->type, bp, sizeof(argp->type));
bp += sizeof(argp->type);
- memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid));
- bp += sizeof(argp->txnid->txnid);
+ memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid));
+ bp += sizeof(argp->txnp->txnid);
memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
bp += sizeof(DB_LSN);
@@ -944,10 +952,10 @@ __fop_rename_read(dbenv, recbuf, argpp)
* PUBLIC: u_int32_t, u_int32_t));
*/
int
-__fop_file_remove_log(dbenv, txnid, ret_lsnp, flags,
+__fop_file_remove_log(dbenv, txnp, ret_lsnp, flags,
real_fid, tmp_fid, name, appname, child)
DB_ENV *dbenv;
- DB_TXN *txnid;
+ DB_TXN *txnp;
DB_LSN *ret_lsnp;
u_int32_t flags;
const DBT *real_fid;
@@ -973,29 +981,30 @@ __fop_file_remove_log(dbenv, txnid, ret_lsnp, flags,
ret = 0;
if (LF_ISSET(DB_LOG_NOT_DURABLE)) {
- if (txnid == NULL)
+ if (txnp == NULL)
+ return (0);
+ if (txnp == NULL)
return (0);
is_durable = 0;
} else
is_durable = 1;
- if (txnid == NULL) {
+ if (txnp == NULL) {
txn_num = 0;
lsnp = &null_lsn;
null_lsn.file = null_lsn.offset = 0;
} else {
- if (TAILQ_FIRST(&txnid->kids) != NULL &&
- (ret = __txn_activekids(dbenv, rectype, txnid)) != 0)
+ if (TAILQ_FIRST(&txnp->kids) != NULL &&
+ (ret = __txn_activekids(dbenv, rectype, txnp)) != 0)
return (ret);
/*
* We need to assign begin_lsn while holding region mutex.
* That assignment is done inside the DbEnv->log_put call,
* so pass in the appropriate memory location to be filled
* in by the log_put code.
- */
- DB_SET_BEGIN_LSNP(txnid, &rlsnp);
- txn_num = txnid->txnid;
- lsnp = &txnid->last_lsn;
+ */
+ DB_SET_TXN_LSNP(txnp, &rlsnp, &lsnp);
+ txn_num = txnp->txnid;
}
logrec.size = sizeof(rectype) + sizeof(txn_num) + sizeof(DB_LSN)
@@ -1010,7 +1019,7 @@ __fop_file_remove_log(dbenv, txnid, ret_lsnp, flags,
logrec.size += npad;
}
- if (is_durable || txnid == NULL) {
+ if (is_durable || txnp == NULL) {
if ((ret =
__os_malloc(dbenv, logrec.size, &logrec.data)) != 0)
return (ret);
@@ -1083,12 +1092,13 @@ __fop_file_remove_log(dbenv, txnid, ret_lsnp, flags,
memcpy(bp, &uinttmp, sizeof(uinttmp));
bp += sizeof(uinttmp);
- DB_ASSERT((u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
+ DB_ASSERT(dbenv,
+ (u_int32_t)(bp - (u_int8_t *)logrec.data) <= logrec.size);
- if (is_durable || txnid == NULL) {
+ if (is_durable || txnp == NULL) {
if ((ret = __log_put(dbenv, rlsnp,(DBT *)&logrec,
- flags | DB_LOG_NOCOPY)) == 0 && txnid != NULL) {
- txnid->last_lsn = *rlsnp;
+ flags | DB_LOG_NOCOPY)) == 0 && txnp != NULL) {
+ *lsnp = *rlsnp;
if (rlsnp != ret_lsnp)
*ret_lsnp = *rlsnp;
}
@@ -1107,20 +1117,21 @@ __fop_file_remove_log(dbenv, txnid, ret_lsnp, flags,
#else
ret = 0;
#endif
- STAILQ_INSERT_HEAD(&txnid->logs, lr, links);
+ STAILQ_INSERT_HEAD(&txnp->logs, lr, links);
+ F_SET((TXN_DETAIL *)txnp->td, TXN_DTL_INMEMORY);
LSN_NOT_LOGGED(*ret_lsnp);
}
#ifdef LOG_DIAGNOSTIC
if (ret != 0)
(void)__fop_file_remove_print(dbenv,
- (DBT *)&logrec, ret_lsnp, NULL, NULL);
+ (DBT *)&logrec, ret_lsnp, DB_TXN_PRINT, NULL);
#endif
#ifdef DIAGNOSTIC
__os_free(dbenv, logrec.data);
#else
- if (is_durable || txnid == NULL)
+ if (is_durable || txnp == NULL)
__os_free(dbenv, logrec.data);
#endif
return (ret);
@@ -1145,13 +1156,14 @@ __fop_file_remove_read(dbenv, recbuf, argpp)
sizeof(__fop_file_remove_args) + sizeof(DB_TXN), &argp)) != 0)
return (ret);
bp = recbuf;
- argp->txnid = (DB_TXN *)&argp[1];
+ argp->txnp = (DB_TXN *)&argp[1];
+ memset(argp->txnp, 0, sizeof(DB_TXN));
memcpy(&argp->type, bp, sizeof(argp->type));
bp += sizeof(argp->type);
- memcpy(&argp->txnid->txnid, bp, sizeof(argp->txnid->txnid));
- bp += sizeof(argp->txnid->txnid);
+ memcpy(&argp->txnp->txnid, bp, sizeof(argp->txnp->txnid));
+ bp += sizeof(argp->txnp->txnid);
memcpy(&argp->prev_lsn, bp, sizeof(DB_LSN));
bp += sizeof(DB_LSN);