Scrub first the just synced blocks

This commit is contained in:
Andrea Mazzoleni 2015-08-27 18:58:25 +02:00
parent 9a5f30cd32
commit cca2cbb23f
9 changed files with 74 additions and 49 deletions

View file

@ -975,6 +975,19 @@ static inline int info_get_justsynced(snapraid_info info)
return (info & 0x4) != 0;
}
/**
* Get the latest scrub time.
*
* If the block was not scrubbed, 0 is returned.
*/
static inline time_t info_get_scrubtime(snapraid_info info)
{
if (info_get_justsynced(info))
return 0;
else
return info_get_time(info);
}
/**
* Marks the block address as with error.
*/
@ -1019,9 +1032,9 @@ static inline snapraid_info info_get(tommy_arrayblkof* array, unsigned pos)
}
/**
* Compares info by time.
* Compare times
*/
int info_time_compare(const void* void_a, const void* void_b);
int time_compare(const void* void_a, const void* void_b);
#endif