Add a new justsynced info bit to position

The value 0 means that the block is scrubbed, and it allows
an easy conversion of past content files.
Note that past versions ignore this info when using binary
content files, then we don't increase the version of the format.
This commit is contained in:
Andrea Mazzoleni 2015-08-27 18:02:12 +02:00
parent 5537c9339e
commit 9a5f30cd32
4 changed files with 41 additions and 11 deletions

View file

@ -1020,7 +1020,7 @@ static int state_sync_process(struct snapraid_state* state, struct snapraid_pari
}
/* we update the info block only if we really have updated the parity */
/* because otherwise the time info would be misleading as we didn't */
/* because otherwise the time/justsynced info would be misleading as we didn't */
/* wrote the parity at this time */
/* we also update the info block only if no silent error was found */
/* because has no sense to refresh the time for data that we know bad */
@ -1039,7 +1039,7 @@ static int state_sync_process(struct snapraid_state* state, struct snapraid_pari
/* update the time info of the block */
/* we are also clearing any previous bad and rehash flag */
info_set(&state->infoarr, i, info_make(now, 0, 0));
info_set(&state->infoarr, i, info_make(now, 0, 0, 1));
}
}