fix config.h error for installed copies of stasis
This commit is contained in:
parent
f947a2b417
commit
b5b414490a
6 changed files with 20 additions and 16 deletions
|
@ -131,7 +131,7 @@ lsn_t sizeofLogEntry(const LogEntry * e) {
|
|||
switch (e->type) {
|
||||
case CLRLOG:
|
||||
{
|
||||
const LogEntry * contents = getCLRCompensated(e);
|
||||
const LogEntry * contents = getCLRCompensated((const CLRLogEntry*) e);
|
||||
assert(contents->type != CLRLOG);
|
||||
return sizeof(struct __raw_log_entry) + sizeofLogEntry(contents);
|
||||
}
|
||||
|
|
|
@ -152,16 +152,20 @@ lsn_t LogCLR(stasis_log_t* log, const LogEntry * old_e) {
|
|||
|
||||
lsn_t LogDummyCLR(stasis_log_t* log, int xid, lsn_t prevLSN,
|
||||
lsn_t compensatedLSN) {
|
||||
const LogEntry * const_e;
|
||||
LogEntry * e;
|
||||
if(compensatedLSN == -1) {
|
||||
e = allocUpdateLogEntry(prevLSN, xid, OPERATION_NOOP,
|
||||
const_e = allocUpdateLogEntry(prevLSN, xid, OPERATION_NOOP,
|
||||
INVALID_PAGE, NULL, 0);
|
||||
} else {
|
||||
e = log->read_entry(log, compensatedLSN);
|
||||
const_e = log->read_entry(log, compensatedLSN);
|
||||
}
|
||||
e = malloc(sizeofLogEntry(const_e));
|
||||
memcpy(e, const_e, sizeofLogEntry(const_e));
|
||||
e->LSN = compensatedLSN;
|
||||
lsn_t ret = LogCLR(log, e);
|
||||
freeLogEntry(e);
|
||||
freeLogEntry(const_e);
|
||||
free(e);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
#include <stasis/allocationPolicy.h>
|
||||
#include <stasis/blobManager.h>
|
||||
#include <stasis/page.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
//try{
|
||||
/**
|
||||
|
|
|
@ -203,7 +203,7 @@ static void stasis_recovery_redo(stasis_log_t* log) {
|
|||
// if compensated_lsn == -1, then this clr is closing a nested top
|
||||
// action that was performed during undo. Therefore, we do not
|
||||
// want to undo it again.
|
||||
const LogEntry * ce = getCLRCompensated(e);
|
||||
const LogEntry * ce = getCLRCompensated((const CLRLogEntry*)e);
|
||||
if(-1 != ce->LSN) {
|
||||
if(ce->update.page == INVALID_PAGE) {
|
||||
// logical redo of end of NTA; no-op
|
||||
|
@ -308,7 +308,7 @@ static void stasis_recovery_undo(stasis_log_t* log, int recovery) {
|
|||
}
|
||||
case CLRLOG:
|
||||
{
|
||||
const LogEntry * ce = getCLRCompensated(e);
|
||||
const LogEntry * ce = getCLRCompensated((const CLRLogEntry*) e);
|
||||
if(-1 != ce->LSN) {
|
||||
if(ce->update.page == INVALID_PAGE) {
|
||||
DEBUG("logical clr\n");
|
||||
|
|
|
@ -53,18 +53,16 @@ terms specified in this license.
|
|||
* the right thing' and build, even if they do not \#include the
|
||||
* config.h file that all of the Stasis stuff uses.
|
||||
*
|
||||
* @todo Figure out how to let Stasis users avoid config.h.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
//#define NDEBUG 1
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifndef __stasis_common_h
|
||||
#define __stasis_common_h
|
||||
|
||||
#include <sys/types.h> // for size_t
|
||||
|
||||
#ifdef __cplusplus
|
||||
# define BEGIN_C_DECLS extern "C" {
|
||||
# define END_C_DECLS }
|
||||
|
|
|
@ -130,7 +130,7 @@ const void * getUpdateArgs(const LogEntry * e);
|
|||
/**
|
||||
@return a copy of the log entry that this CLR compensated.
|
||||
*/
|
||||
static inline const LogEntry * getCLRCompensated(const LogEntry * e) {
|
||||
static inline const LogEntry * getCLRCompensated(const CLRLogEntry * e) {
|
||||
return (const LogEntry*)(
|
||||
((const struct __raw_log_entry*)e)+1
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue