*
* compressed_common.h
*
* Copyright (c) 2021 Huawei Technologies Co.,Ltd.
*
* -------------------------------------------------------------------------
*/
#ifndef OPENGAUSS_SERVER_COMPRESS_COMPRESSED_COMMON_H
#define OPENGAUSS_SERVER_COMPRESS_COMPRESSED_COMMON_H
#include "utils/atomic.h"
struct RewindCompressInfo {
bool compressed = false;
uint32 oldBlockNumber = 0;
uint32 newBlockNumber = 0;
};
#define COPY_REWIND_COMPRESS_INFO(entry, infoPointer, oldBlock, newBlock) \
(entry)->rewindCompressInfo.oldBlockNumber = 0; \
(entry)->rewindCompressInfo.newBlockNumber = 0; \
(entry)->rewindCompressInfo.compressed = false; \
if ((infoPointer) != NULL && (infoPointer)->compressed) { \
(entry)->rewindCompressInfo.oldBlockNumber = (oldBlock); \
(entry)->rewindCompressInfo.newBlockNumber = (newBlock); \
(entry)->rewindCompressInfo.compressed = true; \
}
#endif