mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-30 20:06:56 -05:00
Speed up reading of content file disabling mutexes
This commit is contained in:
parent
34ee2bf2a6
commit
b8b1d38781
4 changed files with 21 additions and 2 deletions
|
|
@ -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)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue