progress->write_streams.completed_streams += complete_count;
}
- if (progress->write_streams.completed_bytes >= progress_data->next_progress)
- {
+ if (progress->write_streams.completed_bytes >= progress_data->next_progress) {
+
ret = call_progress(progress_data->progfunc,
WIMLIB_PROGRESS_MSG_WRITE_STREAMS,
progress,
if (ret)
return ret;
- if (progress_data->next_progress == progress->write_streams.total_bytes) {
- progress_data->next_progress = ~(u64)0;
- } else {
- /* Handle rate-limiting of messages */
-
- /* Send new message as soon as another 1/128 of the
- * total has been written. (Arbitrary number.) */
- progress_data->next_progress =
- progress->write_streams.completed_bytes +
- progress->write_streams.total_bytes / 128;
-
- /* ... Unless that would be more than 5000000 bytes, in
- * which case send the next after the next 5000000
- * bytes. (Another arbitrary number.) */
- if (progress->write_streams.completed_bytes + 5000000 <
- progress_data->next_progress)
- progress_data->next_progress =
- progress->write_streams.completed_bytes + 5000000;
-
- /* ... But always send a message as soon as we're
- * completely done. */
- if (progress->write_streams.total_bytes <
- progress_data->next_progress)
- progress_data->next_progress =
- progress->write_streams.total_bytes;
- }
+ set_next_progress(progress->write_streams.completed_bytes,
+ progress->write_streams.total_bytes,
+ &progress_data->next_progress);
}
return 0;
}
inode = blob->file_inode;
wimlib_assert(inode != NULL);
- wimlib_assert(inode->num_remaining_streams > 0);
- if (--inode->num_remaining_streams > 0)
+ wimlib_assert(inode->i_num_remaining_streams > 0);
+ if (--inode->i_num_remaining_streams > 0)
return 0;
#ifdef __WIN32__
list_for_each_entry(blob, blob_list, write_blobs_list) {
if (blob_is_in_file(blob)) {
- blob->file_inode->num_remaining_streams = 0;
+ blob->file_inode->i_num_remaining_streams = 0;
blob->may_send_done_with_file = 1;
} else {
blob->may_send_done_with_file = 0;
list_for_each_entry(blob, blob_list, write_blobs_list)
if (blob->may_send_done_with_file)
- blob->file_inode->num_remaining_streams++;
+ blob->file_inode->i_num_remaining_streams++;
}
/*