Eliminate obsolete raid_zero API and dedicated zero buffers
Some checks are pending
Build / build-mac (push) Waiting to run
Build / build-linux (push) Waiting to run
Build / build-arm32 (push) Waiting to run
Build / build-win (push) Waiting to run
Build / build-freebsd (push) Waiting to run
Build / build-musl (push) Waiting to run
CodeQL Advanced / Analyze (c-cpp) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run

This commit is contained in:
Andrea Mazzoleni 2026-09-02 20:49:06 +02:00
parent 8f27c393d6
commit 0b64fb2eae
7 changed files with 66 additions and 68 deletions

View file

@ -215,15 +215,7 @@
* [5] Plank, "Screaming Fast Galois Field Arithmetic Using Intel SIMD Instructions", 2013
*/
/**
* Buffer filled with 0 used in recovering.
*/
static void *raid_zero_block;
void raid_zero(void *zero)
{
raid_zero_block = zero;
}
/**
* Inverts the square matrix M of size nxn into V.

View file

@ -161,32 +161,10 @@ int raid_mode(int mode);
* The test modifies global RAID state and must not be called concurrently
* with any other RAID function.
*
* The test resets the zero buffer to 0 via raid_zero(0) upon completion.
* A valid zero buffer must be set with raid_zero() afterwards before calling
* recovery functions (raid_rec(), raid_data()).
*
* It returns 0 on success.
*/
int raid_selftest(void);
/**
* Sets the zero buffer to use during recovery.
*
* 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.
*
* The selected zero buffer is global to the RAID library. raid_zero() must
* not be called concurrently with any other RAID function.
*
* Once set, the buffer must remain valid and unchanged while it is being
* used by recovery operations.
*/
void raid_zero(void *zero);
/**
* Block aliasing
*