diff --git a/cmdline/dry.c b/cmdline/dry.c index 5c314fb8..18b6b2b3 100644 --- a/cmdline/dry.c +++ b/cmdline/dry.c @@ -47,7 +47,9 @@ static int state_dry_process(struct snapraid_state* state, struct snapraid_parit error = 0; - /* dry all the blocks in files */ + /* drop until now */ + state_usage_waste(state); + countmax = blockmax - blockstart; countsize = 0; countpos = 0; @@ -57,15 +59,19 @@ static int state_dry_process(struct snapraid_state* state, struct snapraid_parit for(j=0;jblock_size, stdlog); if (read_size == -1) { - fprintf(stdlog, "error:%u:%s:%s: Read error at position %u\n", i, handle[j].disk->name, block_file_get(block)->sub, block_file_pos(block)); + fprintf(stdlog, "error:%u:%s:%s: Read error at position %u\n", i, disk->name, block_file_get(block)->sub, block_file_pos(block)); ++error; continue; } + /* until now is disk */ + state_usage_disk(state, disk); + countsize += read_size; } /* read the parity */ for(l=0;llevel;++l) { if (parity[l]) { + /* until now is CPU */ + state_usage_cpu(state); + ret = parity_read(parity[l], i, buffer_aligned, state->block_size, stdlog); if (ret == -1) { fprintf(stdlog, "parity_error:%u:%s: Read error\n", i, lev_config_name(l)); ++error; } + + /* until now is parity */ + state_usage_parity(state, l); } } @@ -126,6 +141,8 @@ static int state_dry_process(struct snapraid_state* state, struct snapraid_parit state_progress_end(state, countpos, countmax, countsize); + state_usage_print(state); + bail: /* close all the files left open */ for(j=0;j