From 0e93a577c9bacb7d824ce6c293dae68163ca3cbe Mon Sep 17 00:00:00 2001 From: Sears Russell Date: Mon, 12 Oct 2009 22:26:32 +0000 Subject: [PATCH] use INVALID_LSN instead of hardcoded -1 --- src/stasis/logger/logger2.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/stasis/logger/logger2.c b/src/stasis/logger/logger2.c index b32a0ad..b30b68f 100644 --- a/src/stasis/logger/logger2.c +++ b/src/stasis/logger/logger2.c @@ -59,7 +59,7 @@ static lsn_t stasis_log_write_common(stasis_log_t* log, TransactionLog * l, int log->write_entry(log, e); pthread_mutex_lock(&l->mut); - if(l->prevLSN == -1) { l->recLSN = e->LSN; } + if(l->prevLSN == INVALID_LSN) { l->recLSN = e->LSN; } l->prevLSN = e->LSN; pthread_mutex_unlock(&l->mut); @@ -82,7 +82,7 @@ static lsn_t stasis_log_write_prepare(stasis_log_t* log, TransactionLog * l) { log->write_entry(log, e); pthread_mutex_lock(&l->mut); - if(l->prevLSN == -1) { l->recLSN = e->LSN; } + if(l->prevLSN == INVALID_LSN) { l->recLSN = e->LSN; } l->prevLSN = e->LSN; pthread_mutex_unlock(&l->mut); DEBUG("Log Common prepare XXX %d, LSN: %ld type: %ld (prevLSN %ld)\n", @@ -107,7 +107,7 @@ LogEntry * stasis_log_write_update(stasis_log_t* log, TransactionLog * l, DEBUG("Log Update %d, LSN: %ld type: %ld (prevLSN %ld) (arg_size %ld)\n", e->xid, (long int)e->LSN, (long int)e->type, (long int)e->prevLSN, (long int) arg_size); pthread_mutex_lock(&l->mut); - if(l->prevLSN == -1) { l->recLSN = e->LSN; } + if(l->prevLSN == INVALID_LSN) { l->recLSN = e->LSN; } l->prevLSN = e->LSN; pthread_mutex_unlock(&l->mut); return e; @@ -121,7 +121,7 @@ LogEntry * stasis_log_begin_nta(stasis_log_t* log, TransactionLog * l, unsigned lsn_t stasis_log_end_nta(stasis_log_t* log, TransactionLog * l, LogEntry * e) { log->write_entry(log, e); pthread_mutex_lock(&l->mut); - if(l->prevLSN == -1) { l->recLSN = e->LSN; } + if(l->prevLSN == INVALID_LSN) { l->recLSN = e->LSN; } lsn_t ret = l->prevLSN = e->LSN; pthread_mutex_unlock(&l->mut); freeLogEntry(e); @@ -153,8 +153,8 @@ void stasis_log_begin_transaction(stasis_log_t* log, int xid, TransactionLog* tl tl->xid = xid; DEBUG("Log Begin %d\n", xid); - tl->prevLSN = -1; - tl->recLSN = -1; + tl->prevLSN = INVALID_LSN; + tl->recLSN = INVALID_LSN; } lsn_t stasis_log_abort_transaction(stasis_log_t* log, TransactionLog * l) {