mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
Make 64-byte block alignment an explicit requirement in RAID API
This commit is contained in:
parent
ee4e3175c8
commit
bcaabd6dc0
2 changed files with 22 additions and 13 deletions
12
raid/raid.h
12
raid/raid.h
|
|
@ -133,6 +133,8 @@ int raid_mode(int mode);
|
|||
* Before calling raid_rec() and raid_data() you must provide a memory
|
||||
* buffer filled with zeros of the same size as the blocks to recover.
|
||||
*
|
||||
* The buffer pointed to by @zero must be aligned to a 64-byte boundary.
|
||||
*
|
||||
* This buffer is only read and never written.
|
||||
*/
|
||||
void raid_zero(void *zero);
|
||||
|
|
@ -152,7 +154,7 @@ void raid_zero(void *zero);
|
|||
* It has (@nd + @np) elements. The starting elements are the blocks for
|
||||
* data, following with the parity blocks.
|
||||
* Data blocks are only read and not modified. Parity blocks are written.
|
||||
* Each block has @size bytes.
|
||||
* Each block has @size bytes and must be aligned to a 64-byte boundary.
|
||||
*/
|
||||
void raid_gen(int nd, int np, size_t size, void **v);
|
||||
|
||||
|
|
@ -187,7 +189,7 @@ void raid_gen(int nd, int np, size_t size, void **v);
|
|||
* @v Vector of pointers to the blocks of data and parity.
|
||||
* It has (@nd + @np) elements. The starting elements are the blocks
|
||||
* for data, following with the parity blocks.
|
||||
* Each block has @size bytes.
|
||||
* Each block has @size bytes and must be aligned to a 64-byte boundary.
|
||||
*/
|
||||
void raid_rec(int nr, int *ir, int nd, int np, size_t size, void **v);
|
||||
|
||||
|
|
@ -207,7 +209,7 @@ void raid_rec(int nr, int *ir, int nd, int np, size_t size, void **v);
|
|||
* @v Vector of pointers to the blocks of data and parity.
|
||||
* It has (@nd + @ip[@nr - 1] + 1) elements. The starting elements are the
|
||||
* blocks for data, following with the parity blocks.
|
||||
* Each block has @size bytes.
|
||||
* Each block has @size bytes and must be aligned to a 64-byte boundary.
|
||||
*/
|
||||
void raid_data(int nr, int *id, int *ip, int nd, size_t size, void **v);
|
||||
|
||||
|
|
@ -234,7 +236,7 @@ void raid_data(int nr, int *id, int *ip, int nd, size_t size, void **v);
|
|||
* @v Vector of pointers to the blocks of data and parity.
|
||||
* It has (@nd + @np) elements. The starting elements are the blocks
|
||||
* for data, following with the parity blocks.
|
||||
* Each block has @size bytes.
|
||||
* Each block has @size bytes and must be aligned to a 64-byte boundary.
|
||||
* @return 0 if the check is satisfied. -1 otherwise.
|
||||
*/
|
||||
int raid_check(int nr, int *ir, int nd, int np, size_t size, void **v);
|
||||
|
|
@ -271,7 +273,7 @@ int raid_check(int nr, int *ir, int nd, int np, size_t size, void **v);
|
|||
* @v Vector of pointers to the blocks of data and parity.
|
||||
* It has (@nd + @np) elements. The starting elements are the blocks
|
||||
* for data, following with the parity blocks.
|
||||
* Each block has @size bytes.
|
||||
* Each block has @size bytes and must be aligned to a 64-byte boundary.
|
||||
* @return Number of block indexes returned in the @ir vector.
|
||||
* 0 if no error is detected.
|
||||
* -1 if it's not possible to identify the failed disks.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue