mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 10:51:54 -04:00
Skip extent locking during single-threaded content serialization
This commit is contained in:
parent
03545f1685
commit
1073c97e0a
1 changed files with 16 additions and 0 deletions
|
|
@ -4878,8 +4878,24 @@ static void state_write_content(struct snapraid_state* state, uint32_t* out_crc)
|
|||
context->f = f;
|
||||
context->first = 1;
|
||||
|
||||
#if HAVE_THREAD
|
||||
/* this non-MT path is the only user of the extent trees until serialization completes. */
|
||||
for (i = state->disklist; i != 0; i = i->next) {
|
||||
struct snapraid_disk* disk = i->data;
|
||||
disk->single_thread = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
retval = state_write_thread(context);
|
||||
|
||||
#if HAVE_THREAD
|
||||
/* restore locking before any later phase can start worker threads. */
|
||||
for (i = state->disklist; i != 0; i = i->next) {
|
||||
struct snapraid_disk* disk = i->data;
|
||||
disk->single_thread = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* abort on failure */
|
||||
if (retval) {
|
||||
/* LCOV_EXCL_START */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue