mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-02 12:57:14 -05:00
Adds the new autosave configuration option.
Checks the parity validity invariant after reading the content file.
This commit is contained in:
parent
e927c8d905
commit
2a50ec747d
11 changed files with 209 additions and 28 deletions
6
elem.h
6
elem.h
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue