Adds the new autosave configuration option.

Checks the parity validity invariant after reading the content file.
This commit is contained in:
Andrea Mazzoleni 2012-03-13 23:59:59 +01:00
parent e927c8d905
commit 2a50ec747d
11 changed files with 209 additions and 28 deletions

6
elem.h
View file

@ -80,6 +80,9 @@ struct snapraid_file;
/**
* The block has the hash computed, but the parity is invalid.
* This happens when the parity is invalidated by a change in another block.
* Note that this state is almost reduntant because we can detect that the parity is invalid
* also checking the other disks, where for sure exists a block the BLOCK_STATE_CHG/NEW state
* or a BLOCK_DELETED block.
*/
#define BLOCK_STATE_INV 2
@ -300,6 +303,9 @@ block_off_t block_file_pos(struct snapraid_block* block);
*/
int block_is_last(struct snapraid_block* block);
/**
* Checks if the block is a real allocated block.
*/
static inline int block_is_valid(struct snapraid_block* block)
{
return block != BLOCK_EMPTY && block != BLOCK_DELETED;