[PATCH 23/28] xor: add a better public API
From: Christoph Hellwig
Date: Fri Mar 27 2026 - 02:51:05 EST
xor_blocks is very annoying to use, because it is limited to 4 + 1
sources / destinations, has an odd argument order and is completely
undocumented.
Lift the code that loops around it from btrfs and async_tx/async_xor into
common code under the name xor_gen and properly document it.
Signed-off-by: Christoph Hellwig <hch@xxxxxx>
---
lib/raid/xor/xor-core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/raid/xor/xor-core.c b/lib/raid/xor/xor-core.c
index 07e06db32731..2e46b6b83b0a 100644
--- a/lib/raid/xor/xor-core.c
+++ b/lib/raid/xor/xor-core.c
@@ -65,6 +65,8 @@ void xor_gen(void *dest, void **srcs, unsigned int src_cnt, unsigned int bytes)
{
unsigned int src_off = 0;
+ WARN_ON_ONCE(in_interrupt());
+ WARN_ON_ONCE(bytes == 0);
WARN_ON_ONCE(bytes & 511);
while (src_cnt > 0) {
--
2.47.3