lib_log: improve debugging

This commit is contained in:
Thomas Schoebel-Theuer 2012-12-10 16:42:48 +01:00 committed by Thomas Schoebel-Theuer
parent f1af13b52b
commit 8244b7293a
1 changed files with 7 additions and 0 deletions

View File

@ -8,6 +8,8 @@
//#define MARS_DEBUGGING
//#define IO_DEBUGGING
#define MAX_RESERVE PAGE_SIZE
#include "lib_log.h"
void exit_logst(struct log_status *logst)
@ -178,6 +180,11 @@ void *log_reserve(struct log_status *logst, struct log_header *lh)
int offset;
int status;
if (unlikely(lh->l_len <= 0 || lh->l_len > MAX_RESERVE)) {
MARS_ERR("trying to write %d bytes, max allowed = %d\n", lh->l_len, (int)PAGE_SIZE);
goto err;
}
MARS_IO("reserving %d bytes at %lld\n", lh->l_len, logst->log_pos);
mref = logst->log_mref;