mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-04 22:00:19 -05:00
Adds test for scrub.
This commit is contained in:
parent
d93f2f0595
commit
33cf866699
3 changed files with 24 additions and 4 deletions
14
scrub.c
14
scrub.c
|
|
@ -331,11 +331,17 @@ int state_scrub(struct snapraid_state* state)
|
|||
|
||||
blockmax = parity_size(state);
|
||||
|
||||
/* by default scrub 1/12 of the array */
|
||||
countlimit = blockmax / 12;
|
||||
if (state->opt.force_scrub) {
|
||||
/* scrub the specified amount of blocks */
|
||||
countlimit = state->opt.force_scrub;
|
||||
recentlimit = now;
|
||||
} else {
|
||||
/* by default scrub 1/12 of the array */
|
||||
countlimit = blockmax / 12;
|
||||
|
||||
/* by default use a 10 day time limit */
|
||||
recentlimit = now - 10 * 24 * 3600;
|
||||
/* by default use a 10 day time limit */
|
||||
recentlimit = now - 10 * 24 * 3600;
|
||||
}
|
||||
|
||||
/* identify the time limit */
|
||||
/* we sort all the block times, and we identify the time limit for which we reach the quota */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue