[PATCH 22/25] async_xor: use xor_gen

Christoph Hellwig
2026-02-26T15:14:41Z

Replace use of the loop around xor_blocks with the easier to use xor_gen
API.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
crypto/async_tx/async_xor.c | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/crypto/async_tx/async_xor.c b/crypto/async_tx/async_xor.c
index 2c499654a36c..460960d45388 100644
--- a/crypto/async_tx/async_xor.c
+++ b/crypto/async_tx/async_xor.c
@@ -103,7 +103,6 @@ do_sync_xor_offs(struct page *dest, unsigned int offset,
{
int i;
int xor_src_cnt = 0;
- int src_off = 0;
void *dest_buf;
void **srcs;

@@ -117,23 +116,12 @@ do_sync_xor_offs(struct page *dest, unsigned int offset,
if (src_list[i])
srcs[xor_src_cnt++] = page_address(src_list[i]) +
(src_offs ? src_offs[i] : offset);
- src_cnt = xor_src_cnt;
+
/* set destination address */
dest_buf = page_address(dest) + offset;
-
if (submit->flags & ASYNC_TX_XOR_ZERO_DST)
memset(dest_buf, 0, len);
-
- while (src_cnt > 0) {
- /* process up to 'MAX_XOR_BLOCKS' sources */
- xor_src_cnt = min(src_cnt, MAX_XOR_BLOCKS);
- xor_blocks(xor_src_cnt, len, dest_buf, &srcs[src_off]);
-
- /* drop completed sources */
- src_cnt -= xor_src_cnt;
- src_off += xor_src_cnt;
- }
-
+ xor_gen(dest_buf, srcs, xor_src_cnt, len);
async_tx_sync_epilog(submit);
}

--
2.47.3