|
38 | 38 | #endif |
39 | 39 |
|
40 | 40 | // Autofill to struct sector_hdr_data |
41 | | -enum { |
42 | | - TSL_HDR_PADDING_SIZE = FDB_WG_ALIGN(sizeof(uint32_t)) - sizeof(uint32_t) |
43 | | -}; |
| 41 | +#define SECTOR_HDR_PADDING_SIZE (FDB_WG_ALIGN(4) - 4) |
44 | 42 |
|
45 | 43 | // Autofill to struct log_idx_data |
46 | | -enum { |
| 44 | +#ifdef FDB_USING_TIMESTAMP_64BIT |
| 45 | +#define _TSL_FDBTIME_SIZE (8) |
| 46 | +#else |
| 47 | +#define _TSL_FDBTIME_SIZE (4) |
| 48 | +#endif |
| 49 | + |
47 | 50 | #ifdef FDB_TSDB_FIXED_BLOB_SIZE |
48 | | - LOG_IDX_BASE_SIZE = TSL_STATUS_TABLE_SIZE + sizeof(fdb_time_t), |
| 51 | +#define LOG_IDX_BASE_SIZE (TSL_STATUS_TABLE_SIZE + _TSL_FDBTIME_SIZE) |
49 | 52 | #else |
50 | | - LOG_IDX_BASE_SIZE = TSL_STATUS_TABLE_SIZE + sizeof(fdb_time_t) + sizeof(uint32_t) * 2, |
| 53 | +#define LOG_IDX_BASE_SIZE (TSL_STATUS_TABLE_SIZE + _TSL_FDBTIME_SIZE + 4 * 2) |
51 | 54 | #endif |
52 | | - LOG_IDX_PADDING_SIZE = FDB_WG_ALIGN(LOG_IDX_BASE_SIZE) - LOG_IDX_BASE_SIZE |
53 | | -}; |
| 55 | + |
| 56 | +#define LOG_IDX_PADDING_SIZE (FDB_WG_ALIGN(LOG_IDX_BASE_SIZE) - LOG_IDX_BASE_SIZE) |
54 | 57 |
|
55 | 58 | #define SECTOR_HDR_DATA_SIZE (FDB_WG_ALIGN(sizeof(struct sector_hdr_data))) |
56 | 59 | #define LOG_IDX_DATA_SIZE (FDB_WG_ALIGN(sizeof(struct log_idx_data))) |
@@ -107,8 +110,8 @@ struct sector_hdr_data { |
107 | 110 | uint32_t reserved; |
108 | 111 |
|
109 | 112 | // Autofill to the FDB WRITE GRAN alignment |
110 | | -#if TSL_HDR_PADDING_SIZE > 0 |
111 | | - uint8_t padding[TSL_HDR_PADDING_SIZE]; |
| 113 | +#if SECTOR_HDR_PADDING_SIZE > 0 |
| 114 | + uint8_t padding[SECTOR_HDR_PADDING_SIZE]; |
112 | 115 | #endif |
113 | 116 | }; |
114 | 117 | typedef struct sector_hdr_data *sector_hdr_data_t; |
|
0 commit comments