diff --git a/raid/raid.c b/raid/raid.c index f4cf481a..8f7636db 100644 --- a/raid/raid.c +++ b/raid/raid.c @@ -171,7 +171,7 @@ /** * Generator matrix currently used. */ -const uint8_t(*raid_gfgen)[256]; +const uint8_t (*raid_gfgen)[256]; void raid_mode(int mode) { diff --git a/raid/raid.h b/raid/raid.h index 2682b64a..43a831ee 100644 --- a/raid/raid.h +++ b/raid/raid.h @@ -18,8 +18,7 @@ /** * RAID mode supporting up to 6 parities. * - * It requires SSSE3 to get good performance with triple or more - * parities. + * It requires SSSE3 to get good performance with triple or more parities. * * This is the default mode set after calling raid_init(). */ @@ -28,8 +27,9 @@ /** * RAID mode supporting up to 3 parities, * - * It has a fast triple parity implementation even without SSSE3, but it - * cannot go beyond triple parity. + * It has a fast triple parity implementation without SSSE3, but it cannot + * go beyond triple parity. + * * This is mostly intended for low end CPUs like ARM and AMD Athlon. */ #define RAID_MODE_VANDERMONDE 1 @@ -46,12 +46,19 @@ /** * Initializes the RAID system. + * + * You must call this function before any other. + * + * The RAID system is initialized in the RAID_MODE_CAUCHY mode. */ void raid_init(void); /** * Runs a basic functionality self test. * + * The test is immediate, and it's intended to be run at application + * startup to check the integrity of the RAID system. + * * It returns 0 on success. */ int raid_selftest(void); @@ -78,12 +85,12 @@ void raid_mode(int mode); void raid_zero(void *zero); /** - * Computes the parity blocks. + * Computes parity blocks. * * This function computes the specified number of parity blocks of the * provided set of data blocks. * - * Each parity block, will allow to recover one data block. + * Each parity block allows to recover one data block. * * @nd Number of data blocks. * @np Number of parities blocks to compute. @@ -107,12 +114,12 @@ void raid_gen(int nd, int np, size_t size, void **v); * The parities blocks used for recovering are automatically selected from * the ones NOT present in the @ir vector. * - * In case there are more parity blocks than needed to recover, the parities - * at lower indexes are used in the recovering, and the others are ignored. + * In case there are more parity blocks than needed, the parities at lower + * indexes are used in the recovering, and the others are ignored. * * Note that no internal integrity check is done when recovering. If the - * provided parities are correct the resulting data will be also correct. - * If parities are wrong, also the resulting recovered data will be wrong. + * provided parities are correct, the resulting data will be correct. + * If parities are wrong, the resulting recovered data will be wrong. * This happens even in the case you have more parities blocks than needed, * and some form of integrity verification would be possible. * @@ -132,7 +139,7 @@ void raid_gen(int nd, int np, size_t size, void **v); void raid_rec(int nr, int *ir, int nd, int np, size_t size, void **v); /** - * Recovers failures of data blocks using the specified parities. + * Recovers failures in data blocks using the specified parities. * * The data blocks marked as bad in the @id vector are recovered. * The parity blocks are not modified.