Keeps track of the last sync time of each block.

This commit is contained in:
Andrea Mazzoleni 2013-06-23 22:54:54 +02:00
parent ef53cd4086
commit e0164b29d1
3 changed files with 39 additions and 10 deletions

7
sync.c
View file

@ -45,6 +45,10 @@ static int state_sync_process(struct snapraid_state* state, struct snapraid_pari
block_off_t autosavemissing;
int ret;
unsigned unrecoverable_error;
time_t now;
/* get the present time */
now = time(0);
/* maps the disks to handles */
handle = handle_map(state, &diskmax);
@ -309,6 +313,9 @@ static int state_sync_process(struct snapraid_state* state, struct snapraid_pari
/* now all the blocks have the hash and the parity computed */
block_state_set(block, BLOCK_STATE_BLK);
}
/* update the time info of the block */
info_set(&state->infoarr, i, info_make(now));
}
/* mark the state as needing write */