mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-02 12:57:14 -05:00
Adds the -t option to limit the number of blocks processed.
More tests with incomplete sync.
This commit is contained in:
parent
25841deb04
commit
87bb5c7a66
9 changed files with 93 additions and 557 deletions
7
sync.c
7
sync.c
|
|
@ -217,7 +217,7 @@ bail:
|
|||
return 0;
|
||||
}
|
||||
|
||||
int state_sync(struct snapraid_state* state, block_off_t blockstart)
|
||||
int state_sync(struct snapraid_state* state, block_off_t blockstart, block_off_t blockcount)
|
||||
{
|
||||
char path[PATH_MAX];
|
||||
block_off_t blockmax;
|
||||
|
|
@ -236,6 +236,11 @@ int state_sync(struct snapraid_state* state, block_off_t blockstart)
|
|||
fprintf(stderr, "Error in the starting block %u. It's bigger than the parity size %u.\n", blockstart, blockmax);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/* adjust the number of block to process */
|
||||
if (blockcount != 0 && blockstart + blockcount < blockmax) {
|
||||
blockmax = blockstart + blockcount;
|
||||
}
|
||||
|
||||
pathcpy(path, sizeof(path), state->parity);
|
||||
f = parity_create(path, size);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue