mirror of https://github.com/schoebel/mars
lib_log: make padding verbose
This commit is contained in:
parent
e416e99b4c
commit
84f44fa106
|
@ -412,7 +412,7 @@ bool log_finalize(struct log_status *logst, int len, void (*endio)(void *private
|
||||||
padded_len = len;
|
padded_len = len;
|
||||||
if (logst->do_compress) {
|
if (logst->do_compress) {
|
||||||
int new_len = log_compress(logst, len, &check_flags);
|
int new_len = log_compress(logst, len, &check_flags);
|
||||||
int padded_new_len = ((new_len + 7) / 8) * 8;
|
int padded_new_len = ((new_len + (_LOG_PAD-1)) / _LOG_PAD) * _LOG_PAD;
|
||||||
|
|
||||||
if (new_len > 0 && padded_new_len < len) {
|
if (new_len > 0 && padded_new_len < len) {
|
||||||
/* exchange the lengths */
|
/* exchange the lengths */
|
||||||
|
|
|
@ -100,6 +100,10 @@ struct log_header_v1 {
|
||||||
|
|
||||||
#define OVERHEAD (START_OVERHEAD + END_OVERHEAD)
|
#define OVERHEAD (START_OVERHEAD + END_OVERHEAD)
|
||||||
|
|
||||||
|
/* alignment of log positions to 64bit */
|
||||||
|
#define _LOG_PAD_BITS 3
|
||||||
|
#define _LOG_PAD (1 << _LOG_PAD_BITS)
|
||||||
|
|
||||||
// TODO: make this bytesex-aware.
|
// TODO: make this bytesex-aware.
|
||||||
#define DATA_PUT(data,offset,val) \
|
#define DATA_PUT(data,offset,val) \
|
||||||
do { \
|
do { \
|
||||||
|
|
Loading…
Reference in New Issue