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

16
util.h
View file

@ -121,6 +121,12 @@ static inline unsigned bit_clear(unsigned bit, unsigned mask)
*/
void* malloc_nofail(size_t size);
/**
* Safe aligned malloc.
* If no memory is available, it aborts.
*/
void* malloc_nofail_align(size_t size, void** freeptr);
/**
* Xor two memory blocks.
*/
@ -133,9 +139,15 @@ void memxor(unsigned char* xor, const unsigned char* block, unsigned size);
#define HASH_SIZE 16
/**
* Computes the hash of a memory block.
* Hash kinds.
*/
void memhash(void* digest, const void* src, unsigned size);
#define HASH_MURMUR3 0
#define HASH_MD5 1
/**
* Computes the HASH of a memory block.
*/
void memhash(unsigned kind, void* digest, const void* src, unsigned size);
#endif