mirror of https://github.com/schoebel/mars
lib_log: improve debugging
This commit is contained in:
parent
f1af13b52b
commit
8244b7293a
|
@ -8,6 +8,8 @@
|
||||||
//#define MARS_DEBUGGING
|
//#define MARS_DEBUGGING
|
||||||
//#define IO_DEBUGGING
|
//#define IO_DEBUGGING
|
||||||
|
|
||||||
|
#define MAX_RESERVE PAGE_SIZE
|
||||||
|
|
||||||
#include "lib_log.h"
|
#include "lib_log.h"
|
||||||
|
|
||||||
void exit_logst(struct log_status *logst)
|
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 offset;
|
||||||
int status;
|
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);
|
MARS_IO("reserving %d bytes at %lld\n", lh->l_len, logst->log_pos);
|
||||||
|
|
||||||
mref = logst->log_mref;
|
mref = logst->log_mref;
|
||||||
|
|
Loading…
Reference in New Issue