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.

btrfs: use xor_gen

Use the new xor_gen helper instead of open coding the loop around
xor_blocks. This helper is very similar to the existing run_xor helper in
btrfs, except that the destination buffer is passed explicitly.

Link: https://lkml.kernel.org/r/20260327061704.3707577-26-hch@lst.de
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: David Sterba <dsterba@suse.com>
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: 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
0f629e72 7c12c32b

+4 -23
+4 -23
fs/btrfs/raid56.c
··· 618 618 } 619 619 620 620 /* 621 - * helper function to run the xor_blocks api. It is only 622 - * able to do MAX_XOR_BLOCKS at a time, so we need to 623 - * loop through. 624 - */ 625 - static void run_xor(void **pages, int src_cnt, ssize_t len) 626 - { 627 - int src_off = 0; 628 - int xor_src_cnt = 0; 629 - void *dest = pages[src_cnt]; 630 - 631 - while(src_cnt > 0) { 632 - xor_src_cnt = min(src_cnt, MAX_XOR_BLOCKS); 633 - xor_blocks(xor_src_cnt, len, dest, pages + src_off); 634 - 635 - src_cnt -= xor_src_cnt; 636 - src_off += xor_src_cnt; 637 - } 638 - } 639 - 640 - /* 641 621 * Returns true if the bio list inside this rbio covers an entire stripe (no 642 622 * rmw required). 643 623 */ ··· 1414 1434 } else { 1415 1435 /* raid5 */ 1416 1436 memcpy(pointers[rbio->nr_data], pointers[0], step); 1417 - run_xor(pointers + 1, rbio->nr_data - 1, step); 1437 + xor_gen(pointers[rbio->nr_data], pointers + 1, rbio->nr_data - 1, 1438 + step); 1418 1439 } 1419 1440 for (stripe = stripe - 1; stripe >= 0; stripe--) 1420 1441 kunmap_local(pointers[stripe]); ··· 2015 2034 pointers[rbio->nr_data - 1] = p; 2016 2035 2017 2036 /* Xor in the rest */ 2018 - run_xor(pointers, rbio->nr_data - 1, step); 2037 + xor_gen(p, pointers, rbio->nr_data - 1, step); 2019 2038 } 2020 2039 2021 2040 cleanup: ··· 2653 2672 } else { 2654 2673 /* RAID5. */ 2655 2674 memcpy(pointers[nr_data], pointers[0], step); 2656 - run_xor(pointers + 1, nr_data - 1, step); 2675 + xor_gen(pointers[nr_data], pointers + 1, nr_data - 1, step); 2657 2676 } 2658 2677 2659 2678 /* Check scrubbing parity and repair it. */