mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-25 18:59:33 +03:00
Minor style cleanup
Resolve an assortment of style inconsistencies including use of white space, typos, capitalization, and line wrapping. There is no functional change. Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: George Melikov <mail@gmelikov.ru> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #9030
This commit is contained in:
parent
446d08fba4
commit
984bfb373f
@ -18,7 +18,8 @@ AC_DEFUN([ZFS_AC_KERNEL_FPU], [
|
|||||||
#include <asm/fpu/api.h>
|
#include <asm/fpu/api.h>
|
||||||
],[
|
],[
|
||||||
],[
|
],[
|
||||||
AC_DEFINE(HAVE_KERNEL_FPU_API_HEADER, 1, [kernel has asm/fpu/api.h])
|
AC_DEFINE(HAVE_KERNEL_FPU_API_HEADER, 1,
|
||||||
|
[kernel has asm/fpu/api.h])
|
||||||
AC_MSG_RESULT(asm/fpu/api.h)
|
AC_MSG_RESULT(asm/fpu/api.h)
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(i387.h & xcr.h)
|
AC_MSG_RESULT(i387.h & xcr.h)
|
||||||
@ -39,8 +40,10 @@ AC_DEFUN([ZFS_AC_KERNEL_FPU], [
|
|||||||
kernel_fpu_end();
|
kernel_fpu_end();
|
||||||
], [kernel_fpu_begin], [arch/x86/kernel/fpu/core.c], [
|
], [kernel_fpu_begin], [arch/x86/kernel/fpu/core.c], [
|
||||||
AC_MSG_RESULT(kernel_fpu_*)
|
AC_MSG_RESULT(kernel_fpu_*)
|
||||||
AC_DEFINE(HAVE_KERNEL_FPU, 1, [kernel has kernel_fpu_* functions])
|
AC_DEFINE(HAVE_KERNEL_FPU, 1,
|
||||||
AC_DEFINE(KERNEL_EXPORTS_X86_FPU, 1, [kernel exports FPU functions])
|
[kernel has kernel_fpu_* functions])
|
||||||
|
AC_DEFINE(KERNEL_EXPORTS_X86_FPU, 1,
|
||||||
|
[kernel exports FPU functions])
|
||||||
],[
|
],[
|
||||||
ZFS_LINUX_TRY_COMPILE_SYMBOL([
|
ZFS_LINUX_TRY_COMPILE_SYMBOL([
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
|
@ -26,8 +26,10 @@
|
|||||||
* USER API:
|
* USER API:
|
||||||
*
|
*
|
||||||
* Kernel fpu methods:
|
* Kernel fpu methods:
|
||||||
* kfpu_begin()
|
* kfpu_allowed()
|
||||||
* kfpu_end()
|
* kfpu_initialize()
|
||||||
|
* kfpu_begin()
|
||||||
|
* kfpu_end()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SIMD_AARCH64_H
|
#ifndef _SIMD_AARCH64_H
|
||||||
|
@ -26,8 +26,10 @@
|
|||||||
* USER API:
|
* USER API:
|
||||||
*
|
*
|
||||||
* Kernel fpu methods:
|
* Kernel fpu methods:
|
||||||
* kfpu_begin()
|
* kfpu_allowed()
|
||||||
* kfpu_end()
|
* kfpu_initialize()
|
||||||
|
* kfpu_begin()
|
||||||
|
* kfpu_end()
|
||||||
*
|
*
|
||||||
* SIMD support:
|
* SIMD support:
|
||||||
*
|
*
|
||||||
@ -37,31 +39,31 @@
|
|||||||
* all relevant feature test functions should be called.
|
* all relevant feature test functions should be called.
|
||||||
*
|
*
|
||||||
* Supported features:
|
* Supported features:
|
||||||
* zfs_sse_available()
|
* zfs_sse_available()
|
||||||
* zfs_sse2_available()
|
* zfs_sse2_available()
|
||||||
* zfs_sse3_available()
|
* zfs_sse3_available()
|
||||||
* zfs_ssse3_available()
|
* zfs_ssse3_available()
|
||||||
* zfs_sse4_1_available()
|
* zfs_sse4_1_available()
|
||||||
* zfs_sse4_2_available()
|
* zfs_sse4_2_available()
|
||||||
*
|
*
|
||||||
* zfs_avx_available()
|
* zfs_avx_available()
|
||||||
* zfs_avx2_available()
|
* zfs_avx2_available()
|
||||||
*
|
*
|
||||||
* zfs_bmi1_available()
|
* zfs_bmi1_available()
|
||||||
* zfs_bmi2_available()
|
* zfs_bmi2_available()
|
||||||
*
|
*
|
||||||
* zfs_avx512f_available()
|
* zfs_avx512f_available()
|
||||||
* zfs_avx512cd_available()
|
* zfs_avx512cd_available()
|
||||||
* zfs_avx512er_available()
|
* zfs_avx512er_available()
|
||||||
* zfs_avx512pf_available()
|
* zfs_avx512pf_available()
|
||||||
* zfs_avx512bw_available()
|
* zfs_avx512bw_available()
|
||||||
* zfs_avx512dq_available()
|
* zfs_avx512dq_available()
|
||||||
* zfs_avx512vl_available()
|
* zfs_avx512vl_available()
|
||||||
* zfs_avx512ifma_available()
|
* zfs_avx512ifma_available()
|
||||||
* zfs_avx512vbmi_available()
|
* zfs_avx512vbmi_available()
|
||||||
*
|
*
|
||||||
* NOTE(AVX-512VL): If using AVX-512 instructions with 128Bit registers
|
* NOTE(AVX-512VL): If using AVX-512 instructions with 128Bit registers
|
||||||
* also add zfs_avx512vl_available() to feature check.
|
* also add zfs_avx512vl_available() to feature check.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SIMD_X86_H
|
#ifndef _SIMD_X86_H
|
||||||
@ -190,7 +192,7 @@ typedef struct cpuid_feature_desc {
|
|||||||
* Descriptions of supported instruction sets
|
* Descriptions of supported instruction sets
|
||||||
*/
|
*/
|
||||||
static const cpuid_feature_desc_t cpuid_features[] = {
|
static const cpuid_feature_desc_t cpuid_features[] = {
|
||||||
[SSE] = {1U, 0U, 1U << 25, EDX },
|
[SSE] = {1U, 0U, 1U << 25, EDX },
|
||||||
[SSE2] = {1U, 0U, 1U << 26, EDX },
|
[SSE2] = {1U, 0U, 1U << 26, EDX },
|
||||||
[SSE3] = {1U, 0U, 1U << 0, ECX },
|
[SSE3] = {1U, 0U, 1U << 0, ECX },
|
||||||
[SSSE3] = {1U, 0U, 1U << 9, ECX },
|
[SSSE3] = {1U, 0U, 1U << 9, ECX },
|
||||||
|
@ -303,16 +303,21 @@ aes_impl_init(void)
|
|||||||
}
|
}
|
||||||
aes_supp_impl_cnt = c;
|
aes_supp_impl_cnt = c;
|
||||||
|
|
||||||
/* set fastest implementation. assume hardware accelerated is fastest */
|
/*
|
||||||
|
* Set the fastest implementation given the assumption that the
|
||||||
|
* hardware accelerated version is the fastest.
|
||||||
|
*/
|
||||||
#if defined(__x86_64)
|
#if defined(__x86_64)
|
||||||
#if defined(HAVE_AES)
|
#if defined(HAVE_AES)
|
||||||
if (aes_aesni_impl.is_supported())
|
if (aes_aesni_impl.is_supported()) {
|
||||||
memcpy(&aes_fastest_impl, &aes_aesni_impl,
|
memcpy(&aes_fastest_impl, &aes_aesni_impl,
|
||||||
sizeof (aes_fastest_impl));
|
sizeof (aes_fastest_impl));
|
||||||
else
|
} else
|
||||||
#endif
|
#endif
|
||||||
|
{
|
||||||
memcpy(&aes_fastest_impl, &aes_x86_64_impl,
|
memcpy(&aes_fastest_impl, &aes_x86_64_impl,
|
||||||
sizeof (aes_fastest_impl));
|
sizeof (aes_fastest_impl));
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
memcpy(&aes_fastest_impl, &aes_generic_impl,
|
memcpy(&aes_fastest_impl, &aes_generic_impl,
|
||||||
sizeof (aes_fastest_impl));
|
sizeof (aes_fastest_impl));
|
||||||
|
@ -646,7 +646,7 @@ const gcm_impl_ops_t *gcm_all_impl[] = {
|
|||||||
/* Indicate that benchmark has been completed */
|
/* Indicate that benchmark has been completed */
|
||||||
static boolean_t gcm_impl_initialized = B_FALSE;
|
static boolean_t gcm_impl_initialized = B_FALSE;
|
||||||
|
|
||||||
/* Select aes implementation */
|
/* Select GCM implementation */
|
||||||
#define IMPL_FASTEST (UINT32_MAX)
|
#define IMPL_FASTEST (UINT32_MAX)
|
||||||
#define IMPL_CYCLE (UINT32_MAX-1)
|
#define IMPL_CYCLE (UINT32_MAX-1)
|
||||||
|
|
||||||
@ -713,13 +713,15 @@ gcm_impl_init(void)
|
|||||||
|
|
||||||
/* set fastest implementation. assume hardware accelerated is fastest */
|
/* set fastest implementation. assume hardware accelerated is fastest */
|
||||||
#if defined(__x86_64) && defined(HAVE_PCLMULQDQ)
|
#if defined(__x86_64) && defined(HAVE_PCLMULQDQ)
|
||||||
if (gcm_pclmulqdq_impl.is_supported())
|
if (gcm_pclmulqdq_impl.is_supported()) {
|
||||||
memcpy(&gcm_fastest_impl, &gcm_pclmulqdq_impl,
|
memcpy(&gcm_fastest_impl, &gcm_pclmulqdq_impl,
|
||||||
sizeof (gcm_fastest_impl));
|
sizeof (gcm_fastest_impl));
|
||||||
else
|
} else
|
||||||
#endif
|
#endif
|
||||||
|
{
|
||||||
memcpy(&gcm_fastest_impl, &gcm_generic_impl,
|
memcpy(&gcm_fastest_impl, &gcm_generic_impl,
|
||||||
sizeof (gcm_fastest_impl));
|
sizeof (gcm_fastest_impl));
|
||||||
|
}
|
||||||
|
|
||||||
strcpy(gcm_fastest_impl.name, "fastest");
|
strcpy(gcm_fastest_impl.name, "fastest");
|
||||||
|
|
||||||
@ -742,7 +744,7 @@ static const struct {
|
|||||||
* If we are called before init(), user preference will be saved in
|
* If we are called before init(), user preference will be saved in
|
||||||
* user_sel_impl, and applied in later init() call. This occurs when module
|
* user_sel_impl, and applied in later init() call. This occurs when module
|
||||||
* parameter is specified on module load. Otherwise, directly update
|
* parameter is specified on module load. Otherwise, directly update
|
||||||
* icp_aes_impl.
|
* icp_gcm_impl.
|
||||||
*
|
*
|
||||||
* @val Name of gcm implementation to use
|
* @val Name of gcm implementation to use
|
||||||
* @param Unused.
|
* @param Unused.
|
||||||
|
@ -162,7 +162,7 @@ typedef enum aes_mech_type {
|
|||||||
#endif /* _AES_IMPL */
|
#endif /* _AES_IMPL */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Methods used to define aes implementation
|
* Methods used to define AES implementation
|
||||||
*
|
*
|
||||||
* @aes_gen_f Key generation
|
* @aes_gen_f Key generation
|
||||||
* @aes_enc_f Function encrypts one block
|
* @aes_enc_f Function encrypts one block
|
||||||
|
@ -37,12 +37,12 @@ extern "C" {
|
|||||||
#include <sys/crypto/common.h>
|
#include <sys/crypto/common.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Methods used to define gcm implementation
|
* Methods used to define GCM implementation
|
||||||
*
|
*
|
||||||
* @gcm_mul_f Perform carry-less multiplication
|
* @gcm_mul_f Perform carry-less multiplication
|
||||||
* @gcm_will_work_f Function tests whether implementation will function
|
* @gcm_will_work_f Function tests whether implementation will function
|
||||||
*/
|
*/
|
||||||
typedef void (*gcm_mul_f)(uint64_t *, uint64_t *, uint64_t *);
|
typedef void (*gcm_mul_f)(uint64_t *, uint64_t *, uint64_t *);
|
||||||
typedef boolean_t (*gcm_will_work_f)(void);
|
typedef boolean_t (*gcm_will_work_f)(void);
|
||||||
|
|
||||||
#define GCM_IMPL_NAME_MAX (16)
|
#define GCM_IMPL_NAME_MAX (16)
|
||||||
|
@ -153,8 +153,9 @@ spl_kthread_create(int (*func)(void *), void *data, const char namefmt[], ...)
|
|||||||
if (PTR_ERR(tsk) == -ENOMEM)
|
if (PTR_ERR(tsk) == -ENOMEM)
|
||||||
continue;
|
continue;
|
||||||
return (NULL);
|
return (NULL);
|
||||||
} else
|
} else {
|
||||||
return (tsk);
|
return (tsk);
|
||||||
|
}
|
||||||
} while (1);
|
} while (1);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(spl_kthread_create);
|
EXPORT_SYMBOL(spl_kthread_create);
|
||||||
|
@ -592,8 +592,9 @@ fletcher_4_incremental_byteswap(void *buf, size_t size, void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(_KERNEL)
|
#if defined(_KERNEL)
|
||||||
/* Fletcher 4 kstats */
|
/*
|
||||||
|
* Fletcher 4 kstats
|
||||||
|
*/
|
||||||
static int
|
static int
|
||||||
fletcher_4_kstat_headers(char *buf, size_t size)
|
fletcher_4_kstat_headers(char *buf, size_t size)
|
||||||
{
|
{
|
||||||
@ -669,7 +670,6 @@ fletcher_4_benchmark_impl(boolean_t native, char *data, uint64_t data_size)
|
|||||||
zio_cksum_t zc;
|
zio_cksum_t zc;
|
||||||
uint32_t i, l, sel_save = IMPL_READ(fletcher_4_impl_chosen);
|
uint32_t i, l, sel_save = IMPL_READ(fletcher_4_impl_chosen);
|
||||||
|
|
||||||
|
|
||||||
fletcher_checksum_func_t *fletcher_4_test = native ?
|
fletcher_checksum_func_t *fletcher_4_test = native ?
|
||||||
fletcher_4_native : fletcher_4_byteswap;
|
fletcher_4_native : fletcher_4_byteswap;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user