Print progress message after saving content files when multithreading is disabled

This commit is contained in:
Andrea Mazzoleni 2026-09-13 21:14:38 +02:00
parent f902527a56
commit 08863cd740

View file

@ -4535,6 +4535,9 @@ static void state_write_content(struct snapraid_state* state, uint32_t* out_crc)
block_off_t count_rehash;
block_off_t count_unsynced;
block_off_t count_unscrubbed;
#if !HAVE_MT_WRITE
uint64_t start;
#endif
/* blocks of all array */
blockmax = parity_allocated_size(state);
@ -4642,6 +4645,10 @@ static void state_write_content(struct snapraid_state* state, uint32_t* out_crc)
fs_single_thread(state, 0);
#if !HAVE_MT_WRITE
start = os_tick_ms();
#endif
#if HAVE_MT_WRITE
/* start all writing threads */
first = 1;
@ -4922,6 +4929,15 @@ static void state_write_content(struct snapraid_state* state, uint32_t* out_crc)
/* LCOV_EXCL_STOP */
}
i = tommy_list_head(&state->contentlist);
while (i) {
struct snapraid_content* content = i->data;
msg_progress("Saved %s in %" PRIu64 " seconds\n", content->content, (os_tick_ms() - start) / 1000);
i = i->next;
}
crc = context->crc;
count_file = context->count_file;
count_hardlink = context->count_hardlink;