Skip to content

Commit 3c80fa5

Browse files
committed
[kvdb] add align padding for 64bit write granularity mode
1 parent 53de94f commit 3c80fa5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/fdb_kvdb.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ struct sector_hdr_data {
103103
uint32_t magic; /**< magic word(`E`, `F`, `4`, `0`) */
104104
uint32_t combined; /**< the combined next sector number, 0xFFFFFFFF: not combined */
105105
uint32_t reserved;
106+
#if (FDB_WRITE_GRAN == 64)
107+
uint8_t padding[4]; /**< align padding for 64bit write granularity */
108+
#endif
106109
};
107110
typedef struct sector_hdr_data *sector_hdr_data_t;
108111

@@ -113,6 +116,9 @@ struct kv_hdr_data {
113116
uint32_t crc32; /**< KV node crc32(name_len + data_len + name + value) */
114117
uint8_t name_len; /**< name length */
115118
uint32_t value_len; /**< value length */
119+
#if (FDB_WRITE_GRAN == 64)
120+
uint8_t padding[4]; /**< align padding for 64bit write granularity */
121+
#endif
116122
};
117123
typedef struct kv_hdr_data *kv_hdr_data_t;
118124

0 commit comments

Comments
 (0)