Fix some places where the DDT was still being used with 32-bit values.

This commit is contained in:
2025-10-10 11:45:18 +01:00
parent 30e2024622
commit ffe9311a74
3 changed files with 5 additions and 5 deletions

View File

@@ -140,7 +140,7 @@ typedef struct TapePartitionHashEntry
typedef struct TapeDdtHashEntry
{
uint64_t key; ///< Key: sector address
uint32_t value; ///< Value: DDT entry
uint64_t value; ///< Value: DDT entry
UT_hash_handle hh; ///< UTHASH handle
} TapeDdtHashEntry;

View File

@@ -124,7 +124,7 @@ static int32_t write_cached_secondary_ddt(aaruformat_context *ctx)
ddt_header.start = ctx->cached_ddt_position * items_per_ddt_entry;
// Calculate data size
ddt_header.length = items_per_ddt_entry * sizeof(uint32_t);
ddt_header.length = items_per_ddt_entry * sizeof(uint64_t);
// Calculate CRC64 of the data
crc64_ctx *crc64_context = aaruf_crc64_init();
@@ -230,7 +230,7 @@ static int32_t write_cached_secondary_ddt(aaruformat_context *ctx)
long saved_pos = ftell(ctx->imageStream);
fseek(ctx->imageStream, ctx->primary_ddt_offset + sizeof(DdtHeader2), SEEK_SET);
size_t primary_table_size = ctx->user_data_ddt_header.entries * sizeof(uint32_t);
size_t primary_table_size = ctx->user_data_ddt_header.entries * sizeof(uint64_t);
size_t primary_written_bytes = 0;
primary_written_bytes = fwrite(ctx->user_data_ddt2, primary_table_size, 1, ctx->imageStream);
@@ -322,7 +322,7 @@ static int32_t write_primary_ddt(aaruformat_context *ctx)
}
// Then write the table data (position is already after the header)
size_t primary_table_size = ctx->user_data_ddt_header.entries * sizeof(uint32_t);
size_t primary_table_size = ctx->user_data_ddt_header.entries * sizeof(uint64_t);
// Write the primary table data
size_t written_bytes = 0;

View File

@@ -519,7 +519,7 @@ void *aaruf_create(const char *filepath, const uint32_t media_type, const uint32
TRACE("Primary DDT will be placed at offset %" PRIu64, ctx->primary_ddt_offset);
// Calculate size of primary DDT table
const uint64_t primary_table_size = ctx->user_data_ddt_header.entries * sizeof(uint32_t);
const uint64_t primary_table_size = ctx->user_data_ddt_header.entries * sizeof(uint64_t);
// Calculate where data blocks can start (after primary DDT + header)
if(ctx->user_data_ddt_header.tableShift > 0)