Implementing registered files in io_uring

The windows implementation is disabled, currently registering files in
IO Ring when there is inflight IO operations causes corruptions.

Implementing a config file.

Some code cleanup
This commit is contained in:
2026-04-24 15:30:04 +01:00
parent ab31776658
commit 3393129c5f
5 changed files with 194 additions and 142 deletions

27
config.h Normal file
View File

@@ -0,0 +1,27 @@
#define FILE_HASHES_TXT "file_hashes.txt"
#define HASH_STRLEN 33 // 128-bit hex (32 chars) + null
#define MAX_PATHLEN 4096
#define READ_BLOCK (KiB(64))
#define MULTI_THREADED true
// -------------------- IO Ring Configuration ----------------------
#define USE_IORING 1
#if USE_IORING
#define IORING_BUFFER_SIZE (KiB(256))
#define NUM_BUFFERS_PER_THREAD 32
#define MAX_ACTIVE_FILES 32
#define SUBMIT_TIMEOUT_MS 30000
#define IORING_DEBUG_PRINTS false
#define IORING_DEBUG_STATS false
#if defined(_WIN32) || defined(_WIN64)
#define USE_REGISTERED_FILES false
#elif defined(__linux__)
#define USE_REGISTERED_FILES true
#endif
#endif