mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-28 21:02:43 +01:00
Replace the static array of algorithms with a call to an architecture helper to register algorithms. This serves two purposes: it avoid having to register all algorithms in a single central place, and it removes the need for the priority field by just registering the algorithms that the architecture considers suitable for the currently running CPUs. [[email protected]: register avx512 after avx2] Link: https://lore.kernel.org/[email protected] Link: https://lore.kernel.org/[email protected] Signed-off-by: Christoph Hellwig <[email protected]> Acked-by: Ard Biesheuvel <[email protected]> Tested-by: Ard Biesheuvel <[email protected]> # kunit only on arm64 Cc: Albert Ou <[email protected]> Cc: Alexander Gordeev <[email protected]> Cc: Alexandre Ghiti <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: "Borislav Petkov (AMD)" <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Chris Mason <[email protected]> Cc: Christian Borntraeger <[email protected]> Cc: Dan Williams <[email protected]> Cc: David Sterba <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Herbert Xu <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Cc: Huacai Chen <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Li Nan <[email protected]> Cc: Madhavan Srinivasan <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Nicholas Piggin <[email protected]> Cc: Palmer Dabbelt <[email protected]> Cc: Song Liu <[email protected]> Cc: Sven Schnelle <[email protected]> Cc: Vasily Gorbik <[email protected]> Cc: WANG Xuerui <[email protected]> Cc: Will Deacon <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
42 lines
1.2 KiB
C
42 lines
1.2 KiB
C
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
/*
|
|
* Copyright 2003 H. Peter Anvin - All Rights Reserved
|
|
*/
|
|
#ifndef _PQ_IMPL_H
|
|
#define _PQ_IMPL_H
|
|
|
|
#include <linux/init.h>
|
|
#include <linux/raid/pq_tables.h>
|
|
|
|
/* Routine choices */
|
|
struct raid6_calls {
|
|
const char *name;
|
|
void (*gen_syndrome)(int disks, size_t bytes, void **ptrs);
|
|
void (*xor_syndrome)(int disks, int start, int stop, size_t bytes,
|
|
void **ptrs);
|
|
};
|
|
|
|
struct raid6_recov_calls {
|
|
const char *name;
|
|
void (*data2)(int disks, size_t bytes, int faila, int failb,
|
|
void **ptrs);
|
|
void (*datap)(int disks, size_t bytes, int faila, void **ptrs);
|
|
};
|
|
|
|
void __init raid6_algo_add(const struct raid6_calls *algo);
|
|
void __init raid6_algo_add_default(void);
|
|
void __init raid6_recov_algo_add(const struct raid6_recov_calls *algo);
|
|
|
|
/* for the kunit test */
|
|
const struct raid6_calls *raid6_algo_find(unsigned int idx);
|
|
const struct raid6_recov_calls *raid6_recov_algo_find(unsigned int idx);
|
|
|
|
/* generic implementations */
|
|
extern const struct raid6_calls raid6_intx1;
|
|
extern const struct raid6_calls raid6_intx2;
|
|
extern const struct raid6_calls raid6_intx4;
|
|
extern const struct raid6_calls raid6_intx8;
|
|
extern const struct raid6_recov_calls raid6_recov_intx1;
|
|
|
|
#endif /* _PQ_IMPL_H */
|