Add entry_type to heap_object_t too

This is required to:
1) later inline the last "big_write" entry into the object to slightly reduce memory usage
2) eliminate an ugly hack where entry type is determined by its size
3) make the storage scheme extensible i.e. when adding new entry types
This commit is contained in:
Vitaliy Filippov
2025-12-02 01:52:12 +03:00
parent ef792608b0
commit 2b8a9e3f90
3 changed files with 49 additions and 24 deletions
+6 -4
View File
@@ -22,10 +22,11 @@ struct pool_shard_settings_t
};
#define BS_HEAP_TYPE 7
#define BS_HEAP_SMALL_WRITE 1
#define BS_HEAP_BIG_WRITE 2
#define BS_HEAP_TOMBSTONE 3
#define BS_HEAP_INTENT_WRITE 4
#define BS_HEAP_OBJECT 1
#define BS_HEAP_SMALL_WRITE 2
#define BS_HEAP_BIG_WRITE 3
#define BS_HEAP_TOMBSTONE 4
#define BS_HEAP_INTENT_WRITE 5
#define BS_HEAP_STABLE 8
class blockstore_heap_t;
@@ -68,6 +69,7 @@ struct __attribute__((__packed__)) heap_object_t
// linked list of write entries...
// newest entries are stored first to simplify scanning
int16_t write_pos = 0;
uint8_t entry_type = 0; // BS_HEAP_*
uint32_t crc32c = 0;
uint64_t inode = 0;
uint64_t stripe = 0;