Speed up reading of content file disabling mutexes
Some checks are pending
Build / build-mac (push) Waiting to run
Build / build-linux (push) Waiting to run
Build / build-win (push) Waiting to run
CodeQL Advanced / Analyze (c-cpp) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run

This commit is contained in:
Andrea Mazzoleni 2026-03-11 15:50:49 +01:00
parent 34ee2bf2a6
commit b8b1d38781
4 changed files with 21 additions and 2 deletions

View file

@ -2133,6 +2133,12 @@ static void state_read_content(struct snapraid_state* state, const char* path, S
tommy_array_init(&disk_mapping);
tommy_hashdyn_init(&bucket_hash);
/* mark all disks as single threads */
for (tommy_node* i = state->disklist; i != 0; i = i->next) {
struct snapraid_disk* disk = i->data;
disk->single_thread = 1;
}
ret = sread(f, buffer, 12);
if (ret < 0) {
/* LCOV_EXCL_START */
@ -3231,6 +3237,12 @@ static void state_read_content(struct snapraid_state* state, const char* path, S
}
}
/* mark all disks as multi threads */
for (tommy_node* i = state->disklist; i != 0; i = i->next) {
struct snapraid_disk* disk = i->data;
disk->single_thread = 0;
}
tommy_array_done(&disk_mapping);
if (serror(f)) {