Initial RAID6 support. Not yet complete.

Uses Murmur3 as default hash.
Check now returns and error even if only recoverable errors are present.
This commit is contained in:
Andrea Mazzoleni 2011-04-23 21:38:26 +02:00
parent ad70b7e560
commit 08831c6641
24 changed files with 1624 additions and 394 deletions

10
state.h
View file

@ -26,14 +26,22 @@
*/
extern volatile int global_interrupt;
#define HASH_MURMUR3 0
#define HASH_MD5 1
struct snapraid_state {
int verbose; /**< Verbose output. */
int force_zero; /**< Forced dangerous operations of synching file now with zero size. */
int force_empty; /**< Forced dangerous operations of synching disk now empty. */
int expect_unrecoverable; /**< Expect presence of unrecoverable error in checking or fixing. */
int expect_recoverable; /**< Expect presence of recoverable error in checking. */
int need_write; /**< If the state is changed. */
uint32_t block_size; /**< Block size in bytes. */
char content[PATH_MAX]; /**< Path of the content file. */
char parity[PATH_MAX]; /**< Path of the parity file. */
char qarity[PATH_MAX]; /**< Path of the qarity file. */
unsigned level; /**< Number of parity levels. 1 for RAID5, 2 for RAID6. */
unsigned hash; /**< Hash kind used. */
tommy_array diskarr; /**< Disk array. */
tommy_list excludelist; /**< List of exclusion. */
};
@ -51,7 +59,7 @@ void state_done(struct snapraid_state* state);
/**
* Read the configuration file.
*/
void state_config(struct snapraid_state* state, const char* path, int verbose, int force_zero, int force_empty);
void state_config(struct snapraid_state* state, const char* path, int verbose, int force_zero, int force_empty, int expect_unrecoverable, int expect_recoverable);
/**
* Read the state.