Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

async_xor: use xor_gen

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

Link: https://lkml.kernel.org/r/20260327061704.3707577-25-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eric Biggers <ebiggers@kernel.org>
Tested-by: Eric Biggers <ebiggers@kernel.org>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Alexandre Ghiti <alex@ghiti.fr>
Cc: Andreas Larsson <andreas@gaisler.com>
Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: "Borislav Petkov (AMD)" <bp@alien8.de>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Chris Mason <clm@fb.com>
Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: David Sterba <dsterba@suse.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jason A. Donenfeld <jason@zx2c4.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Li Nan <linan122@huawei.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Magnus Lindholm <linmag7@gmail.com>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Richard Henderson <richard.henderson@linaro.org>
Cc: Richard Weinberger <richard@nod.at>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Song Liu <song@kernel.org>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: Ted Ts'o <tytso@mit.edu>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: WANG Xuerui <kernel@xen0n.name>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Christoph Hellwig and committed by
Andrew Morton
7c12c32b e420f0a8

+10 -24
+10 -24
crypto/async_tx/async_xor.c
··· 103 103 { 104 104 int i; 105 105 int xor_src_cnt = 0; 106 - int src_off = 0; 107 106 void *dest_buf; 108 107 void **srcs; 109 108 ··· 116 117 if (src_list[i]) 117 118 srcs[xor_src_cnt++] = page_address(src_list[i]) + 118 119 (src_offs ? src_offs[i] : offset); 119 - src_cnt = xor_src_cnt; 120 + 120 121 /* set destination address */ 121 122 dest_buf = page_address(dest) + offset; 122 - 123 123 if (submit->flags & ASYNC_TX_XOR_ZERO_DST) 124 124 memset(dest_buf, 0, len); 125 - 126 - while (src_cnt > 0) { 127 - /* process up to 'MAX_XOR_BLOCKS' sources */ 128 - xor_src_cnt = min(src_cnt, MAX_XOR_BLOCKS); 129 - xor_blocks(xor_src_cnt, len, dest_buf, &srcs[src_off]); 130 - 131 - /* drop completed sources */ 132 - src_cnt -= xor_src_cnt; 133 - src_off += xor_src_cnt; 134 - } 135 - 125 + xor_gen(dest_buf, srcs, xor_src_cnt, len); 136 126 async_tx_sync_epilog(submit); 137 127 } 138 128 ··· 156 168 * 157 169 * honored flags: ASYNC_TX_ACK, ASYNC_TX_XOR_ZERO_DST, ASYNC_TX_XOR_DROP_DST 158 170 * 159 - * xor_blocks always uses the dest as a source so the 160 - * ASYNC_TX_XOR_ZERO_DST flag must be set to not include dest data in 161 - * the calculation. The assumption with dma engines is that they only 162 - * use the destination buffer as a source when it is explicitly specified 163 - * in the source list. 171 + * xor_gen always uses the dest as a source so the ASYNC_TX_XOR_ZERO_DST flag 172 + * must be set to not include dest data in the calculation. The assumption with 173 + * dma engines is that they only use the destination buffer as a source when it 174 + * is explicitly specified in the source list. 164 175 * 165 176 * src_list note: if the dest is also a source it must be at index zero. 166 177 * The contents of this array will be overwritten if a scribble region ··· 246 259 * 247 260 * honored flags: ASYNC_TX_ACK, ASYNC_TX_XOR_ZERO_DST, ASYNC_TX_XOR_DROP_DST 248 261 * 249 - * xor_blocks always uses the dest as a source so the 250 - * ASYNC_TX_XOR_ZERO_DST flag must be set to not include dest data in 251 - * the calculation. The assumption with dma engines is that they only 252 - * use the destination buffer as a source when it is explicitly specified 253 - * in the source list. 262 + * xor_gen always uses the dest as a source so the ASYNC_TX_XOR_ZERO_DST flag 263 + * must be set to not include dest data in the calculation. The assumption with 264 + * dma engines is that they only use the destination buffer as a source when it 265 + * is explicitly specified in the source list. 254 266 * 255 267 * src_list note: if the dest is also a source it must be at index zero. 256 268 * The contents of this array will be overwritten if a scribble region