copy: add timestamp of last advance

This commit is contained in:
Thomas Schoebel-Theuer 2014-02-10 13:08:01 +01:00
parent 024c02c532
commit 7697826b5d
2 changed files with 3 additions and 0 deletions

View File

@ -679,6 +679,7 @@ int _run_copy(struct copy_brick *brick)
}
if (count > 0) {
brick->copy_last += count;
get_lamport(&brick->copy_last_stamp);
MARS_IO("new copy_last += %d => %lld\n", count, brick->copy_last);
_update_percent(brick);
}
@ -797,6 +798,7 @@ static int copy_switch(struct copy_brick *brick)
brick->is_aborting = false;
if (!brick->thread) {
brick->copy_last = brick->copy_start;
get_lamport(&brick->copy_last_stamp);
brick->thread = brick_thread_create(_copy_thread, brick, "mars_copy%d", version++);
if (brick->thread) {
brick->trigger = true;

View File

@ -60,6 +60,7 @@ struct copy_brick {
bool abort_mode; // abort on IO error (default is retry forever)
// readonly from outside
loff_t copy_last; // current working position
struct timespec copy_last_stamp;
int copy_error;
int copy_error_count;
int verify_ok_count;